Newer
Older
DungeonShooting / DungeonShooting_Godot / src / test / TestUi / Test.cs
@lijincheng lijincheng on 11 Mar 2023 1 KB 解析ui层级
  1. using Godot;
  2.  
  3. namespace UI;
  4.  
  5. /*
  6. Test
  7. c1
  8. c11
  9. c2
  10. */
  11. public abstract partial class Test : UiBase
  12. {
  13. public UiNode2_c1 c1
  14. {
  15. get
  16. {
  17. if (_c1 == null) _c1 = new UiNode2_c1(GetNode<Control>("c1"));
  18. return _c1;
  19. }
  20. }
  21. public UiNode3_c2 c2
  22. {
  23. get
  24. {
  25. if (_c2 == null) _c2 = new UiNode3_c2(GetNode<Control>("c2"));
  26. return _c2;
  27. }
  28. }
  29.  
  30. private UiNode2_c1 _c1;
  31. private UiNode3_c2 _c2;
  32. public class UiNode1_c11
  33. {
  34. public Control Instance { get; }
  35.  
  36. public UiNode1_c11(Control node)
  37. {
  38. Instance = node;
  39. }
  40.  
  41. public UiNode1_c11 Clone()
  42. {
  43. return new UiNode1_c11((Control)Instance.Duplicate());
  44. }
  45. }
  46. public class UiNode2_c1
  47. {
  48. public Control Instance { get; }
  49.  
  50. public UiNode1_c11 c11
  51. {
  52. get
  53. {
  54. if (_c11 == null) _c11 = new UiNode1_c11(Instance.GetNode<Control>("c11"));
  55. return _c11;
  56. }
  57. }
  58.  
  59. private UiNode1_c11 _c11;
  60.  
  61. public UiNode2_c1(Control node)
  62. {
  63. Instance = node;
  64. }
  65.  
  66. public UiNode2_c1 Clone()
  67. {
  68. return new UiNode2_c1((Control)Instance.Duplicate());
  69. }
  70. }
  71. public class UiNode3_c2
  72. {
  73. public Control Instance { get; }
  74.  
  75. public UiNode3_c2(Control node)
  76. {
  77. Instance = node;
  78. }
  79.  
  80. public UiNode3_c2 Clone()
  81. {
  82. return new UiNode3_c2((Control)Instance.Duplicate());
  83. }
  84. }
  85. }