User Tools

Site Tools


1_guide:2_makeholder

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
1_guide:2_makeholder [2017/06/22 04:52] – external edit 127.0.0.11_guide:2_makeholder [2024/06/18 13:42] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Workflow ====== ====== Workflow ======
-==== 2, Make UI Holder/Panel ====+==== 2, Make an UI Holder(Panel====
  
 === Part1 === === Part1 ===
   - Add an new ui panel type which refer to an ui panle category onto UIHandler.cs   - Add an new ui panel type which refer to an ui panle category onto UIHandler.cs
 +      - <code c#>public enum UIPanelType {
 + /// <summary>
 + /// Basic  = 101
 + /// Global = 200
 + /// Map    = 1000
 + /// Battle = 2000
 + /// </summary>
 +
 + None = 0,
 +
 + //Basic ---------------------------------------------------
 + [UIPrefabDesc("UI_DialogBG_A_0", UIPanelClass.Basic)]
 + [UIPrefabDesc("UI_DialogBG_A_25", UIPanelClass.Basic)]
 + [UIPrefabDesc("UI_DialogBG_Nomal_75", UIPanelClass.Basic)]
 + DialogBG = 51,
 + [UIPrefabDesc("UI_CheckDialog", UIPanelClass.Dlg, UIEnum_DlgBG.Normal)]
 + CheckDialog = 52,
 +        ...
 +        ...
 +        [UIPrefabDesc("UI_Samples", UIPanelClass.Test)]
 +        Samples = 10000,
 +}</code>
   - Update the uiscenedefault.txt with setting current panel as the original scene's default ui   - Update the uiscenedefault.txt with setting current panel as the original scene's default ui
 +    * {{:1_guide:1_guide_2_makeholder_1.png?450}}
   - Update the uilayerpanel.txt   - Update the uilayerpanel.txt
 +    * {{:1_guide:1_guide_2_makeholder_2.png?450}} 
 +    * For example, the DefaultInfo panel will set Root_General2 as its parent transform(The default root for panels is Root_General){{:1_guide:1_guide_2_makeholder_3.png?450}}
 === Part2 === === Part2 ===
-  - Create a binder script+  - Create a binder script.
   - Create a handler script which is partical class.   - Create a handler script which is partical class.
 +    * {{:1_guide:1_guide_2_makeholder_4.png?250}}
 +    * {{:1_guide:1_guide_2_makeholder_6.png?400}}
   - Make a prefab with the UIHolder component addon, then put it under a Resources folder.   - Make a prefab with the UIHolder component addon, then put it under a Resources folder.
 +    * It should be like this.
 +    * {{:1_guide:1_guide_2_makeholder_5.png?500}}
  
 Run the entry.unity and you will see the ui panels made just now. Run the entry.unity and you will see the ui panels made just now.
 +  * Make sure the StartGameState is Test.
 +  * {{:1_guide:1_guide_9.png?500}}
1_guide/2_makeholder.1498107150.txt.gz · Last modified: 2024/06/18 13:44 (external edit)