net.dreditor.uihandling 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/.attestation.p7m +0 -0
  2. package/AnimatorBoolUIVisibility.cs +128 -128
  3. package/AnimatorBoolUIVisibility.cs.meta +11 -11
  4. package/AnimatorUIVisibility.cs +101 -101
  5. package/AnimatorUIVisibility.cs.meta +11 -11
  6. package/CanvasUIVisibility.cs +102 -102
  7. package/CanvasUIVisibility.cs.meta +11 -11
  8. package/CenterReticleOnSafeState.cs +19 -19
  9. package/CenterReticleOnSafeState.cs.meta +11 -11
  10. package/ColorUIVisibility.cs +133 -133
  11. package/ColorUIVisibility.cs.meta +1 -1
  12. package/ConditionOnSceneEvent.cs +42 -42
  13. package/ConditionOnSceneEvent.cs.meta +11 -11
  14. package/ConditionVisibilityEntry.cs +32 -32
  15. package/ConditionVisibilityEntry.cs.meta +1 -1
  16. package/DREditor.UIHandling.asmdef +20 -20
  17. package/DREditor.UIHandling.asmdef.meta +7 -7
  18. package/DialogueUIComponent.cs +80 -80
  19. package/DialogueUIComponent.cs.meta +11 -11
  20. package/EvaluateBoolCondition.cs +76 -76
  21. package/EvaluateBoolCondition.cs.meta +11 -11
  22. package/EvaluateCondition.cs +77 -77
  23. package/EvaluateCondition.cs.meta +11 -11
  24. package/EvaluateContextCondition.cs +43 -43
  25. package/EvaluateContextCondition.cs.meta +1 -1
  26. package/FadeCanvasGroupVisibility.cs +10 -10
  27. package/FadeCanvasGroupVisibility.cs.meta +11 -11
  28. package/FadeGraphicVisibility.cs +10 -10
  29. package/FadeGraphicVisibility.cs.meta +11 -11
  30. package/FadeHelper.cs +50 -50
  31. package/FadeHelper.cs.meta +11 -11
  32. package/FadeVisibility.cs +165 -165
  33. package/FadeVisibility.cs.meta +11 -11
  34. package/GlobalFadeUIVisibility.cs +43 -43
  35. package/GlobalFadeUIVisibility.cs.meta +11 -11
  36. package/HideDialogueUIHandler.cs +54 -54
  37. package/HideDialogueUIHandler.cs.meta +11 -11
  38. package/IModeVisibilityEntry.cs +21 -21
  39. package/IModeVisibilityEntry.cs.meta +1 -1
  40. package/ITrackableVisibility.cs +13 -13
  41. package/ITrackableVisibility.cs.meta +1 -1
  42. package/IUIVisibility.cs +25 -25
  43. package/IUIVisibility.cs.meta +11 -11
  44. package/IWaitAnimationCompleteOnLoad.cs +15 -15
  45. package/IWaitAnimationCompleteOnLoad.cs.meta +11 -11
  46. package/InSafeStateCondition.cs +58 -58
  47. package/InSafeStateCondition.cs.meta +11 -11
  48. package/LetterBoxCanvasHolder.cs +51 -51
  49. package/LetterBoxCanvasHolder.cs.meta +11 -11
  50. package/MatchBoolEventState.cs +42 -42
  51. package/MatchBoolEventState.cs.meta +11 -11
  52. package/MoveUIVisibility.cs +20 -20
  53. package/MoveUIVisibility.cs.meta +11 -11
  54. package/MultiUIVisibility.cs +128 -128
  55. package/MultiUIVisibility.cs.meta +11 -11
  56. package/OnModeVisibilityHandler.cs +39 -39
  57. package/OnModeVisibilityHandler.cs.meta +11 -11
  58. package/ProtagUIWindow.cs +99 -99
  59. package/ProtagUIWindow.cs.meta +11 -11
  60. package/Reticles/HoverReticle.cs +131 -131
  61. package/Reticles/HoverReticle.cs.meta +11 -11
  62. package/Reticles/ObjectNameOnReticle.cs +65 -65
  63. package/Reticles/ObjectNameOnReticle.cs.meta +11 -11
  64. package/Reticles/RaycastReticle.cs +263 -263
  65. package/Reticles/RaycastReticle.cs.meta +11 -11
  66. package/Reticles/Reticle.cs +196 -196
  67. package/Reticles/Reticle.cs.meta +11 -11
  68. package/Reticles/ReticleAnimationComponent.cs +143 -143
  69. package/Reticles/ReticleAnimationComponent.cs.meta +11 -11
  70. package/Reticles/ReticleComponent.cs +34 -34
  71. package/Reticles/ReticleComponent.cs.meta +11 -11
  72. package/Reticles/ReticleIconLayer.cs +26 -26
  73. package/Reticles/ReticleIconLayer.cs.meta +11 -11
  74. package/Reticles.meta +8 -8
  75. package/RotateUIVisibility.cs +28 -28
  76. package/RotateUIVisibility.cs.meta +1 -1
  77. package/{Samples → Samples~}/3DUIVisible.asset +21 -21
  78. package/{Samples → Samples~}/3DUIVisible.asset.meta +8 -8
  79. package/{Samples → Samples~}/Allow_Raycasting.prefab +64 -64
  80. package/{Samples → Samples~}/Allow_Raycasting.prefab.meta +7 -7
  81. package/{Samples → Samples~}/Dialogue_Load_Leave_Condition.prefab +61 -61
  82. package/{Samples → Samples~}/Dialogue_Load_Leave_Condition.prefab.meta +7 -7
  83. package/{Samples → Samples~}/Disable_On_FTE_Minigame.prefab +132 -132
  84. package/{Samples → Samples~}/Disable_On_FTE_Minigame.prefab.meta +7 -7
  85. package/{Samples → Samples~}/Enable_When_In_Leave_Process.prefab +142 -142
  86. package/{Samples → Samples~}/Enable_When_In_Leave_Process.prefab.meta +7 -7
  87. package/{Samples → Samples~}/FreezeUIVisible.asset +20 -20
  88. package/{Samples → Samples~}/FreezeUIVisible.asset.meta +8 -8
  89. package/{Samples → Samples~}/Freeze_UI_System.prefab +331 -331
  90. package/{Samples → Samples~}/Freeze_UI_System.prefab.meta +7 -7
  91. package/{Samples → Samples~}/Global_Fade_UI_Visibility.prefab +48 -48
  92. package/{Samples → Samples~}/Global_Fade_UI_Visibility.prefab.meta +7 -7
  93. package/{Samples → Samples~}/Hide_Dialogue_UI_Handler.prefab +139 -139
  94. package/{Samples → Samples~}/Hide_Dialogue_UI_Handler.prefab.meta +7 -7
  95. package/{Samples → Samples~}/Hide_Dialogue_UI_Handler_Shell.prefab +81 -81
  96. package/{Samples → Samples~}/Hide_Dialogue_UI_Handler_Shell.prefab.meta +7 -7
  97. package/{Samples → Samples~}/Hide_Instant_Dialogue_UI_Handler.prefab +86 -86
  98. package/{Samples → Samples~}/Hide_Instant_Dialogue_UI_Handler.prefab.meta +7 -7
  99. package/{Samples → Samples~}/In_Safe_State_Condition.prefab +56 -56
  100. package/{Samples → Samples~}/In_Safe_State_Condition.prefab.meta +7 -7
  101. package/{Samples → Samples~}/In_Safe_TPFD_State.prefab +59 -59
  102. package/{Samples → Samples~}/In_Safe_TPFD_State.prefab.meta +7 -7
  103. package/{Samples → Samples~}/OnFinishedRoomTransitions.asset +14 -14
  104. package/{Samples → Samples~}/OnFinishedRoomTransitions.asset.meta +8 -8
  105. package/{Samples → Samples~}/PlayHideDialogueSFX.asset +21 -21
  106. package/{Samples → Samples~}/PlayHideDialogueSFX.asset.meta +8 -8
  107. package/{Samples → Samples~}/PostPhaseChange.asset +14 -14
  108. package/{Samples → Samples~}/PostPhaseChange.asset.meta +8 -8
  109. package/{Samples → Samples~}/Post_Phase_Change_Listener.prefab +51 -51
  110. package/{Samples → Samples~}/Post_Phase_Change_Listener.prefab.meta +7 -7
  111. package/{Samples → Samples~}/PrePhaseChange.asset +14 -14
  112. package/{Samples → Samples~}/PrePhaseChange.asset.meta +8 -8
  113. package/{Samples → Samples~}/PrePhaseDialogueEnd.asset +14 -14
  114. package/{Samples → Samples~}/PrePhaseDialogueEnd.asset.meta +8 -8
  115. package/{Samples → Samples~}/Pre_Phase_Change_Listener.prefab +51 -51
  116. package/{Samples → Samples~}/Pre_Phase_Change_Listener.prefab.meta +7 -7
  117. package/{Samples → Samples~}/Pre_Phase_Dialogue_End_Listener.prefab +51 -51
  118. package/{Samples → Samples~}/Pre_Phase_Dialogue_End_Listener.prefab.meta +7 -7
  119. package/{Samples → Samples~}/ProtagUIVisible.asset +20 -20
  120. package/{Samples → Samples~}/ProtagUIVisible.asset.meta +8 -8
  121. package/{Samples → Samples~}/Show_Dialogue_UI_Handler.prefab +106 -106
  122. package/{Samples → Samples~}/Show_Dialogue_UI_Handler.prefab.meta +7 -7
  123. package/{Samples → Samples~}/Show_Dialogue_UI_Handler_Shell.prefab +87 -87
  124. package/{Samples → Samples~}/Show_Dialogue_UI_Handler_Shell.prefab.meta +7 -7
  125. package/{Samples → Samples~}/Show_Instant_Dialogue_UI_Handler.prefab +85 -85
  126. package/{Samples → Samples~}/Show_Instant_Dialogue_UI_Handler.prefab.meta +7 -7
  127. package/{Samples → Samples~}/Show_Reticle_On_Dialogue_Finish.prefab +98 -98
  128. package/{Samples → Samples~}/Show_Reticle_On_Dialogue_Finish.prefab.meta +7 -7
  129. package/{Samples → Samples~}/Show_Trial_Dialogue_UI_Handler.prefab +91 -91
  130. package/{Samples → Samples~}/Show_Trial_Dialogue_UI_Handler.prefab.meta +7 -7
  131. package/{Samples → Samples~}/Stop_Reticle_Confirm_Select_On_Dialogue_Finish.prefab +108 -108
  132. package/{Samples → Samples~}/Stop_Reticle_Confirm_Select_On_Dialogue_Finish.prefab.meta +7 -7
  133. package/{Samples → Samples~}/Toggle_Bool_With_Event.prefab +47 -47
  134. package/{Samples → Samples~}/Toggle_Bool_With_Event.prefab.meta +7 -7
  135. package/{Samples → Samples~}/Toggle_Protag_UI_On_Scene_Event.prefab +124 -124
  136. package/{Samples → Samples~}/Toggle_Protag_UI_On_Scene_Event.prefab.meta +7 -7
  137. package/{Samples → Samples~}/UIVisibility_On_Dialogue_Finish.prefab +51 -51
  138. package/{Samples → Samples~}/UIVisibility_On_Dialogue_Finish.prefab.meta +7 -7
  139. package/{Samples → Samples~}/UI_Visibility_By_Dialogue_Load_State.prefab +201 -201
  140. package/{Samples → Samples~}/UI_Visibility_By_Dialogue_Load_State.prefab.meta +7 -7
  141. package/{Samples → Samples~}/UI_Visibility_On_Bool_With_Event.prefab +57 -57
  142. package/{Samples → Samples~}/UI_Visibility_On_Bool_With_Event.prefab.meta +7 -7
  143. package/{Samples → Samples~}/UI_Visibility_On_Dialogue_Event.prefab +54 -54
  144. package/{Samples → Samples~}/UI_Visibility_On_Dialogue_Event.prefab.meta +7 -7
  145. package/{Samples → Samples~}/UI_Visibility_On_Inverse_Trial_Mode.prefab +142 -142
  146. package/{Samples → Samples~}/UI_Visibility_On_Inverse_Trial_Mode.prefab.meta +7 -7
  147. package/{Samples → Samples~}/UI_Visibility_On_Safe_State.prefab +198 -198
  148. package/{Samples → Samples~}/UI_Visibility_On_Safe_State.prefab.meta +7 -7
  149. package/{Samples → Samples~}/Video_Visibility_ETemplate.prefab +252 -252
  150. package/{Samples → Samples~}/Video_Visibility_ETemplate.prefab.meta +7 -7
  151. package/SetActiveVisibility.cs +41 -41
  152. package/SetActiveVisibility.cs.meta +11 -11
  153. package/ShowDialogueUIHandler.cs +112 -112
  154. package/ShowDialogueUIHandler.cs.meta +11 -11
  155. package/SizeDeltaVisibility.cs +112 -112
  156. package/SizeDeltaVisibility.cs.meta +11 -11
  157. package/SlidePositionVisibility.cs +177 -177
  158. package/SlidePositionVisibility.cs.meta +11 -11
  159. package/StateVisibilityEntry.cs +26 -26
  160. package/StateVisibilityEntry.cs.meta +1 -1
  161. package/ToggleTextVisibility.cs +59 -59
  162. package/ToggleTextVisibility.cs.meta +11 -11
  163. package/TransformUIVisibility.cs +172 -172
  164. package/TransformUIVisibility.cs.meta +1 -1
  165. package/UIVisibilityByDialogueLoadState.cs +93 -93
  166. package/UIVisibilityByDialogueLoadState.cs.meta +11 -11
  167. package/UIVisibilityComponent.cs +144 -144
  168. package/UIVisibilityComponent.cs.meta +11 -11
  169. package/UIVisibilityHandler.cs +39 -39
  170. package/UIVisibilityHandler.cs.meta +11 -11
  171. package/UIVisibilityOnBoolWithEvent.cs +104 -104
  172. package/UIVisibilityOnBoolWithEvent.cs.meta +11 -11
  173. package/UIVisibilityOnDialogueEvent.cs +68 -68
  174. package/UIVisibilityOnDialogueEvent.cs.meta +11 -11
  175. package/UIVisibilityOnDialogueFinish.cs +100 -100
  176. package/UIVisibilityOnDialogueFinish.cs.meta +11 -11
  177. package/UIVisibilityOnSafeState.cs +65 -65
  178. package/UIVisibilityOnSafeState.cs.meta +11 -11
  179. package/UIVisibilityOnSceneEvents.cs +52 -52
  180. package/UIVisibilityOnSceneEvents.cs.meta +11 -11
  181. package/UIVisibilityUtility.cs +38 -38
  182. package/UIVisibilityUtility.cs.meta +11 -11
  183. package/VideoVisibility.cs +107 -107
  184. package/VideoVisibility.cs.meta +11 -11
  185. package/VisibilityEntryBase.cs +43 -43
  186. package/VisibilityEntryBase.cs.meta +1 -1
  187. package/WaitForAnimationOnLoad.cs +45 -45
  188. package/WaitForAnimationOnLoad.cs.meta +11 -11
  189. package/package.json +42 -37
  190. package/package.json.meta +7 -7
  191. package/Samples.meta +0 -8
Binary file
@@ -1,129 +1,129 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using DREditor.Services;
4
- using System.Collections;
5
- using UnityEngine;
6
-
7
- namespace DREditor.UIHandling
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [ClassHeader(nameof(UIVisibilityComponent) +
13
- "\n\n")]
14
- public class AnimatorBoolUIVisibility : UIVisibilityComponent, IToTitleScreen
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- [Tooltip("")]
20
- [SerializeField] protected bool debugLogs = false;
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Tooltip("")]
26
- [SerializeField] protected Animator animator = null;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- [Tooltip("")]
32
- [SerializeField] protected string showBoolTriggerName = "HideBox"; // ShowDUI MoveDUI ConfirmSelect Appear On DisplayName
33
-
34
- /// <summary>
35
- ///
36
- /// </summary>
37
- [Tooltip("")]
38
- [SerializeField] protected string hideBoolTriggerName = "HideBox"; // ShowDUI MoveDUI ConfirmSelect Appear On DisplayName
39
-
40
- /// <summary>
41
- ///
42
- /// </summary>
43
- [Tooltip("")]
44
- [SerializeField] protected bool setBoolOnShow = true;
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- [Tooltip("")]
50
- [SerializeField] protected bool setBoolOnHide = false;
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- [Tooltip("")]
56
- [SerializeField] protected int animatorLayer = 0;
57
-
58
- /// <summary>
59
- ///
60
- /// </summary>
61
- [Tooltip("")]
62
- [SerializeField] protected bool rebindOnTitleScreen = false;
63
-
64
- /// <summary>
65
- ///
66
- /// </summary>
67
- [Tooltip("")]
68
- [SerializeField] protected bool hideOnTitleScreen = false;
69
-
70
- /// <summary>
71
- ///
72
- /// </summary>
73
- [Tooltip("")]
74
- [SerializeField] protected bool rebindOnHide = false;
75
-
76
- /// <summary>
77
- ///
78
- /// </summary>
79
- [Tooltip("")]
80
- [SerializeField] protected bool keepAnimatorStateOnDisable = false;
81
-
82
-
83
- protected virtual void Awake()
84
- {
85
- if (animator != null)
86
- animator.keepAnimatorStateOnDisable = keepAnimatorStateOnDisable;
87
- }
88
-
89
- /// <inheritdoc/>
90
- protected override void ShowUI() => UpdateVisibility(showBoolTriggerName, setBoolOnShow);
91
-
92
- /// <inheritdoc/>
93
- protected override void HideUI()
94
- {
95
- UpdateVisibility(hideBoolTriggerName, setBoolOnHide);
96
-
97
- if (rebindOnHide)
98
- animator.Rebind();
99
- }
100
-
101
-
102
- /// <summary>
103
- ///
104
- /// </summary>
105
- /// <param name="trigger"></param>
106
- /// <param name="triggerState"></param>
107
- protected virtual void UpdateVisibility(string trigger, bool triggerState)
108
- {
109
- if (debugLogs)
110
- UnityEngine.Debug.Log($"REPORT: {gameObject.name}: Is setting {trigger} to {triggerState}.");
111
-
112
- animator.SetBool(trigger, triggerState);
113
- }
114
-
115
- /// <inheritdoc/>
116
- protected override IEnumerator WaitForUIToComplete() => animator.WaitForStateToComplete(animatorLayer);
117
-
118
-
119
- /// <inheritdoc/>
120
- public virtual void ToTitleScreen()
121
- {
122
- if (hideOnTitleScreen)
123
- Hide();
124
-
125
- if (rebindOnTitleScreen)
126
- animator.Rebind();
127
- }
128
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Services;
4
+ using System.Collections;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.UIHandling
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [ClassHeader(nameof(UIVisibilityComponent) +
13
+ "\n\n")]
14
+ public class AnimatorBoolUIVisibility : UIVisibilityComponent, IToTitleScreen
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ [Tooltip("")]
20
+ [SerializeField] protected bool debugLogs = false;
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected Animator animator = null;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected string showBoolTriggerName = "HideBox"; // ShowDUI MoveDUI ConfirmSelect Appear On DisplayName
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected string hideBoolTriggerName = "HideBox"; // ShowDUI MoveDUI ConfirmSelect Appear On DisplayName
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ [Tooltip("")]
44
+ [SerializeField] protected bool setBoolOnShow = true;
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ [Tooltip("")]
50
+ [SerializeField] protected bool setBoolOnHide = false;
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ [Tooltip("")]
56
+ [SerializeField] protected int animatorLayer = 0;
57
+
58
+ /// <summary>
59
+ ///
60
+ /// </summary>
61
+ [Tooltip("")]
62
+ [SerializeField] protected bool rebindOnTitleScreen = false;
63
+
64
+ /// <summary>
65
+ ///
66
+ /// </summary>
67
+ [Tooltip("")]
68
+ [SerializeField] protected bool hideOnTitleScreen = false;
69
+
70
+ /// <summary>
71
+ ///
72
+ /// </summary>
73
+ [Tooltip("")]
74
+ [SerializeField] protected bool rebindOnHide = false;
75
+
76
+ /// <summary>
77
+ ///
78
+ /// </summary>
79
+ [Tooltip("")]
80
+ [SerializeField] protected bool keepAnimatorStateOnDisable = false;
81
+
82
+
83
+ protected virtual void Awake()
84
+ {
85
+ if (animator != null)
86
+ animator.keepAnimatorStateOnDisable = keepAnimatorStateOnDisable;
87
+ }
88
+
89
+ /// <inheritdoc/>
90
+ protected override void ShowUI() => UpdateVisibility(showBoolTriggerName, setBoolOnShow);
91
+
92
+ /// <inheritdoc/>
93
+ protected override void HideUI()
94
+ {
95
+ UpdateVisibility(hideBoolTriggerName, setBoolOnHide);
96
+
97
+ if (rebindOnHide)
98
+ animator.Rebind();
99
+ }
100
+
101
+
102
+ /// <summary>
103
+ ///
104
+ /// </summary>
105
+ /// <param name="trigger"></param>
106
+ /// <param name="triggerState"></param>
107
+ protected virtual void UpdateVisibility(string trigger, bool triggerState)
108
+ {
109
+ if (debugLogs)
110
+ UnityEngine.Debug.Log($"REPORT: {gameObject.name}: Is setting {trigger} to {triggerState}.");
111
+
112
+ animator.SetBool(trigger, triggerState);
113
+ }
114
+
115
+ /// <inheritdoc/>
116
+ protected override IEnumerator WaitForUIToComplete() => animator.WaitForStateToComplete(animatorLayer);
117
+
118
+
119
+ /// <inheritdoc/>
120
+ public virtual void ToTitleScreen()
121
+ {
122
+ if (hideOnTitleScreen)
123
+ Hide();
124
+
125
+ if (rebindOnTitleScreen)
126
+ animator.Rebind();
127
+ }
128
+ }
129
129
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: fea97891c16958842b43df9b1f05879e
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: fea97891c16958842b43df9b1f05879e
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,102 +1,102 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using DREditor.Services;
4
- using System.Collections;
5
- using UnityEngine;
6
-
7
- namespace DREditor.UIHandling
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [ClassHeader(nameof(UIVisibilityComponent) + ", " + nameof(IUIVisibility) + ", " + nameof(IToTitleScreen) +
13
- "\n\n")]
14
- public class AnimatorUIVisibility : UIVisibilityComponent, IToTitleScreen
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- [Tooltip("")]
20
- [SerializeField] protected Animator animator = null;
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Tooltip("")]
26
- [SerializeField] protected string showStateName = "ShowMainUI"; // ShowProtag ShowInstant
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- [Tooltip("")]
32
- [SerializeField] protected string hideStateName = "HideMainUI"; // HideProtag HideInstant
33
-
34
- /// <summary>
35
- ///
36
- /// </summary>
37
- [Tooltip("")]
38
- [SerializeField] protected int animatorLayer = 0;
39
-
40
-
41
- /// <summary>
42
- ///
43
- /// </summary>
44
- [Header("")]
45
- [Divider]
46
- [Tooltip("")]
47
- [SerializeField] protected bool rebindOnPlay = false;
48
-
49
- /// <summary>
50
- ///
51
- /// </summary>
52
- [Tooltip("")]
53
- [SerializeField] protected bool rebindOnTitleScreen = false;
54
-
55
- /// <summary>
56
- ///
57
- /// </summary>
58
- [Tooltip("")]
59
- [SerializeField] protected bool hideOnTitleScreen = true;
60
-
61
-
62
- protected virtual void Start()
63
- {
64
- if (animator == null && !TryGetComponent(out animator))
65
- UnityEngine.Debug.LogError("ALERT: An animator component must be referenced or on the gameobject of this component!");
66
- }
67
-
68
- /// <inheritdoc/>
69
- protected override void ShowUI() => PlayAnimation(showStateName, animatorLayer);
70
-
71
- /// <inheritdoc/>
72
- protected override void HideUI() => PlayAnimation(hideStateName, animatorLayer);
73
-
74
- /// <summary>
75
- ///
76
- /// </summary>
77
- /// <param name="animationName"></param>
78
- /// <param name="animatorLayer"></param>
79
- protected virtual void PlayAnimation(string animationName, int animatorLayer)
80
- {
81
- if (rebindOnPlay)
82
- animator.Rebind();
83
-
84
- if (!string.IsNullOrEmpty(animationName))
85
- animator.Play(animationName, animatorLayer);
86
- }
87
-
88
- /// <inheritdoc/>
89
- protected override IEnumerator WaitForUIToComplete() => animator.WaitForStateToComplete(animatorLayer);
90
-
91
-
92
- /// <inheritdoc/>
93
- public virtual void ToTitleScreen()
94
- {
95
- if (hideOnTitleScreen)
96
- Hide();
97
-
98
- if (rebindOnTitleScreen)
99
- animator.Rebind();
100
- }
101
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Services;
4
+ using System.Collections;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.UIHandling
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [ClassHeader(nameof(UIVisibilityComponent) + ", " + nameof(IUIVisibility) + ", " + nameof(IToTitleScreen) +
13
+ "\n\n")]
14
+ public class AnimatorUIVisibility : UIVisibilityComponent, IToTitleScreen
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ [Tooltip("")]
20
+ [SerializeField] protected Animator animator = null;
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected string showStateName = "ShowMainUI"; // ShowProtag ShowInstant
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected string hideStateName = "HideMainUI"; // HideProtag HideInstant
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected int animatorLayer = 0;
39
+
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ [Header("")]
45
+ [Divider]
46
+ [Tooltip("")]
47
+ [SerializeField] protected bool rebindOnPlay = false;
48
+
49
+ /// <summary>
50
+ ///
51
+ /// </summary>
52
+ [Tooltip("")]
53
+ [SerializeField] protected bool rebindOnTitleScreen = false;
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ [Tooltip("")]
59
+ [SerializeField] protected bool hideOnTitleScreen = true;
60
+
61
+
62
+ protected virtual void Start()
63
+ {
64
+ if (animator == null && !TryGetComponent(out animator))
65
+ UnityEngine.Debug.LogError("ALERT: An animator component must be referenced or on the gameobject of this component!");
66
+ }
67
+
68
+ /// <inheritdoc/>
69
+ protected override void ShowUI() => PlayAnimation(showStateName, animatorLayer);
70
+
71
+ /// <inheritdoc/>
72
+ protected override void HideUI() => PlayAnimation(hideStateName, animatorLayer);
73
+
74
+ /// <summary>
75
+ ///
76
+ /// </summary>
77
+ /// <param name="animationName"></param>
78
+ /// <param name="animatorLayer"></param>
79
+ protected virtual void PlayAnimation(string animationName, int animatorLayer)
80
+ {
81
+ if (rebindOnPlay)
82
+ animator.Rebind();
83
+
84
+ if (!string.IsNullOrEmpty(animationName))
85
+ animator.Play(animationName, animatorLayer);
86
+ }
87
+
88
+ /// <inheritdoc/>
89
+ protected override IEnumerator WaitForUIToComplete() => animator.WaitForStateToComplete(animatorLayer);
90
+
91
+
92
+ /// <inheritdoc/>
93
+ public virtual void ToTitleScreen()
94
+ {
95
+ if (hideOnTitleScreen)
96
+ Hide();
97
+
98
+ if (rebindOnTitleScreen)
99
+ animator.Rebind();
100
+ }
101
+ }
102
102
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: f5a06d60636d0eb4e9fafb7f44e70613
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: f5a06d60636d0eb4e9fafb7f44e70613
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: