百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

ScreenManager

> 编程语言
开源

使用转场功能为 Unity 管理屏幕的灵活方式

568 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用转场功能为 Unity 管理屏幕的灵活方式

ScreenManager

Flexible way to manage your UI with transitions, layers and proper navigation handling for Unity.

Features

  • ScreenEditor inspector
  • but the whole system can be used fully through code
  • Multi-layered stack based navigation ( alertbox > popup > main )
    • Re-usable screen instances
    • Duplication of screens ( popups, alerts )
  • Optimized clean and bloatfree code, no additional libraries required
  • Button-mashing-proof, screens respect their order and animate in/out properly
  • Default input handling using Unity's UI events ( including cancel/back event )
  • Always-on selected button for gamepad and keyboard-aware navigation
  • Spread feature: See all your screens in a grid view for an easier overview and editing
  • Buttons navigation generation
    • Optional focused default button
    • Cancel/back button which is selected when Cancel key is pressed
    • Isolate navigation to the current screen
  • Extendable generic BaseScreen class
    • Including pre-made presets: Animate, Tween, AnimationController
    • Easily create your own type of screen using the BaseScreen class
  • Mobile tested
  • Includes three examples
  • Fully documented code

Gif

( Note: The inspector window is not forcefully updated, which is why it lags a bit behind )

Screenshots

Sample code

screenmgr.Show("MainMenu");
screenmgr.ShowPopup("Alertbox").Message = "Custom Alert Text";
screenmgr.HideAll();

Info

How to use ?

Simply create a new ScreenManager on any canvas element. (Preferably right underneath the main canvas element.)

Ignore the ScreenManager settings for now, let's create some screens.

To start, we can add SimpleTweenScreen under ScreenManager GameObject.

For custom screens: You can either inherit BaseScreen class or any other pre-made classes: AnimatorScreen, Popup, SimpleTweenScreen, TweenedScreen

Once SimpleTweenScreen is added, you'll notice few things :

  • It added a CanvasGroup element
  • It has a lot of strange settings

By default BaseScreen class provides several important settings, these settings are the core of makes the screen work so well :

  • Generation Settings
  • Generate Navigation ( Create explicit navigation so that keyboard/gamepad navigation never leaks to an another screen )
  • Cancel Selection ( Button selected or executed when ESC or back button is pressed )
  • Cancel Selection
  • Hide Current ( Hide previous screen or overlay on top of the previous screen )
  • Keep on Top when hiding ( Keep its drawing order on top when hiding )
  • Layer Priority ( All screens have layers, imagine that an alert box will block all screen changes that are below it but wouldn't block other alert boxes )
  • Default Selection ( Button selected by default when the screen is shown, when left empty : first button found is selected )

You can leave those settings as they are for now, no need for additional configuration.

Once we added SimpleTweenScreen to all our screens, we can define our default screen that's going to be open on run.

Go to ScreenManager ( Shortcut Ctrl+Alt+T or Window/Select ScreenManager in the menu )

Select your SimpleTweenScreen in the Screens section. Once selected you'll see a button named "Set Default" appear.

Click on it, it will set that screen as the default/main screen.

Now that's done we can pass to setting up our buttons.

There's two ways to setup the buttons :

You can either show a screen by its name, or by it's GameObject reference.

( Tutorial to be finished )

Contribution

There's always more to add, so if you want to help then feel free to contribute !

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#navigationpanelsscreenscreenmanager

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言