Module Intro
Coding Style wiki
Basic Instructions
Core module (linked with AssetLoader to achieve automatic unloading), covering the production of major game objects and implementing object naming binding functionality.
- UI Frame (UIFrame, UI = User Interface), supports object naming binding. Starts with underscore _Node@XXX
- Scene Resource (SRFrame, SR = Scene Resource), supports object naming binding. Starts with underscore _Node@XXX
- Unity Scene (USFrame, US = Unity Scene)
- Template Object (CPFrame, CP = Clone Prefab), supports object naming binding. Starts with tilde ~Node@XXX
Application Description
UIFrame (User Interface)
Used to manage UI Prefabs, only supports UGUI, using UIManager to manage objects with UIBase mounted.
- Supports UI Reverse Changes.
- Supports UI Close Stack By Stack.
- Supports UI freezing functionality to prevent click-triggered events during UI animations.
Reminder If you need to make UI animations, you can override ShowAnimation and HideAnimation to execute related transition animations (DoTween, Animation...), and you must correctly call the animationEnd() callback after completing the UI animation to correctly release the UI frozen state.
Reminder Additionally, there is the UI MaskEvent, which can also be customized via override.
| UI Reverse Changes | UI Reverse Changes |
|---|---|
![]() | ![]() |
| UI Close Stack By Stack | UI Close Stack By Stack |
|---|---|
![]() | ![]() |
SRFrame (Scene Resource)
Used to manage Scene Prefabs and Functional Prefabs, using SRManager to manage objects with SRBase mounted.
USFrame (Unity Scene)
Used to manage Unity Scenes, using USManager to manage Unity scenes (supports AssetBundle).
Attention Using the build# prefix will switch to loading from Build Settings -> Scenes In Build. Otherwise, AssetBundle is used.
CPFrame (Clone Prefab)
Used for instantiating Prefab Template Objects, using CPManager to manage Prefabs with CPBase mounted. Mainly used for loading template objects, such as: item icon templates, mail message templates... etc. Direct GameObject.Destroy will automatically execute reference count unloading.
Reminder CPManager does not perform caching for CPBase.
Common Methods Description
- OnCreate: For initial parameters.
- OnBind: For initial events.
- OnPreShow: Can be handled here when there is asynchronous processing or subordinate object control. For example: TopUI sub-link opens LeftUI & RightUI, then you can implement Show LeftUI & RightUI in the OnPreShow method of TopUI.
- Reminder It is not recommended to handle related Show operations in OnPreClose. If done, it's okay because the CloseAll API provides a disabledPreClose parameter switch.
- OnShow: This method is activated when Show is called, and data can be transmitted through the passed object.
- OnClose: This method is activated when Close is called.
- OnRelease: This method is activated when the object is destroyed.
Initial Sequence Description
Important OnCreate (Once) > OnAutoBind (Once) > OnBind (Once) > OnPreShow (EveryOpen) > OnShow (EveryOpen).
Object Binding Description
- Obtain bound GameObject via collector.GetNode("BindName") (Single name binding).
- UIBase & SRBase use _Node@XXX.
- CPBase use ~Node@XXX.
- Obtain bound GameObject[] via collector.GetNodes("BindName") (Multiple bindings with the same name, object order from top to bottom).
- UIBase & SRBase use _Node@XXX.
- CPBase use ~Node@XXX.
- Obtain bound TComponent via collector.GetNodeComponent<TComponent>("BindName") (Single name binding).
- UIBase & SRBase use _Node@XXX.
- CPBase use ~Node@XXX.
- Obtain bound TComponent[] via collector.GetNodeComponents<TComponent>("BindName") (Multiple bindings with the same name, object order from top to bottom).
- UIBase & SRBase use _Node@XXX.
- CPBase use ~Node@XXX.
Auto-generate Stop Binding Tag (Hotkey: Shift+E, E: End)
Reminder Using Hotkey is recommended, otherwise using Right-Click will execute multiple times (actually does not affect auto-generation), but this is a Unity Bug that the official will not fix.
Can shorten the downward search times for binding at Runtime, time complexity is O(N), N = StopEndIdx (Recommended if there are many node objects).
- Important If you specially use Transform.Find to find child objects and a child object name happens to have the # tag, you can ignore it because at Runtime, the # tag will be Replaced with "" to restore the name.


Auto-generate Object Binding Code (Hotkey: Shift+B, B: Bind)
Naming convention uses * to point to TailName
- UIBase & SRBase
- _Node@XXX*Btn (and so on)
- _Node@XXX*Btn*Img*Trans (and so on, supports multiple * pointing to multiple TailNames)
- CPBase
- ~Node@XXX*Btn (and so on)
- ~Node@XXX*Btn*Img*Trans (and so on, supports multiple * pointing to multiple TailNames)
Auto Binding Description

Auto Binding Configuration

Default Component Binding Table (You can add or modify TailName corresponding binding component types in CodeBindingSettings)
(Omitted table for brevity)
Auto-binding generator features distinguish between method types, as follows:
- Auto [Default], automatically saves binding content to code, will automatically override OnAutoBind() and call it.
- Manual [Optional], manually copy binding content to code, will automatically override OnAutoBind() and call it.



