@@ -81,87 +81,36 @@ All-in-One Solution for Indie Game Development · Empowering Indie Developers' D
8181
8282## Quick Start
8383
84- ### 1. Basic UI Class Creation
84+ ### Installation
8585
86- ``` csharp
87- using GameFrameX .UI .UGUI .Runtime ;
88- using UnityEngine ;
86+ Edit your Unity project's ` Packages/manifest.json ` and add the ` scopedRegistries ` section:
8987
90- public class MainMenuUI : UGUI
88+ ``` json
9189{
92- protected override void OnInit (object userData )
93- {
94- base .OnInit (userData );
95- // Initialize UI logic
96- }
97-
98- protected override void OnOpen (object userData )
99- {
100- base .OnOpen (userData );
101- // Logic when UI opens
102- }
103-
104- protected override void OnClose (bool isShutdown , object userData )
90+ "scopedRegistries" : [
10591 {
106- base .OnClose (isShutdown , userData );
107- // Logic when UI closes
92+ "name" : " GameFrameX" ,
93+ "url" : " https://gameframex.upm.alianblank.uk" ,
94+ "scopes" : [
95+ " com.gameframex"
96+ ]
10897 }
98+ ]
10999}
110100```
111101
112- ### 2. Using Extension Methods
102+ ` scopes ` controls which packages are resolved through this registry. Only packages whose names start with ` com.gameframex ` will be fetched from it.
113103
114- ``` csharp
115- using GameFrameX .UI .UGUI .Runtime ;
116- using UnityEngine .UI ;
104+ Then add the package to ` dependencies ` :
117105
118- public class UIController : MonoBehaviour
106+ ``` json
119107{
120- [SerializeField ] private Button startButton ;
121- [SerializeField ] private Image iconImage ;
122- [SerializeField ] private RectTransform panel ;
123-
124- void Start ()
125- {
126- // Button extension method
127- startButton .onClick .Add (OnStartButtonClick );
128-
129- // Image extension method
130- iconImage .SetIcon (" UI/Icons/StartIcon" );
131-
132- // RectTransform extension method
133- panel .MakeFullScreen ();
134- }
135-
136- private void OnStartButtonClick ()
137- {
138- Debug .Log (" Start button clicked!" );
139- }
108+ "dependencies" : {
109+ "com.gameframex.unity.ui.ugui" : " 2.5.1"
110+ }
140111}
141112```
142113
143- ### 3. Using the Code Generator
144-
145- 1 . Select a UGUI prefab in the Hierarchy
146- 2 . Right-click and select ` GameObject/UI/Generate UGUI Code `
147- 3 . Code will be auto-generated in the ` Assets/Hotfix/UI/UGUI/ ` directory
148-
149- ### 4. Using UIImage Component
150-
151- ``` csharp
152- using GameFrameX .UI .UGUI .Runtime ;
153-
154- public class IconDisplay : MonoBehaviour
155- {
156- [SerializeField ] private UIImage iconImage ;
157-
158- void Start ()
159- {
160- // Set icon with async loading support
161- iconImage .icon = " UI/Icons/PlayerAvatar" ;
162- }
163- }
164- ```
165114
166115## License
167116
0 commit comments