net.dreditor.uihandling 0.0.0-stage → 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 +129 -0
  3. package/AnimatorBoolUIVisibility.cs.meta +11 -0
  4. package/AnimatorUIVisibility.cs +102 -0
  5. package/AnimatorUIVisibility.cs.meta +11 -0
  6. package/CanvasUIVisibility.cs +103 -0
  7. package/CanvasUIVisibility.cs.meta +11 -0
  8. package/CenterReticleOnSafeState.cs +20 -0
  9. package/CenterReticleOnSafeState.cs.meta +11 -0
  10. package/ColorUIVisibility.cs +134 -0
  11. package/ColorUIVisibility.cs.meta +2 -0
  12. package/ConditionOnSceneEvent.cs +43 -0
  13. package/ConditionOnSceneEvent.cs.meta +11 -0
  14. package/ConditionVisibilityEntry.cs +33 -0
  15. package/ConditionVisibilityEntry.cs.meta +2 -0
  16. package/DREditor.UIHandling.asmdef +21 -0
  17. package/DREditor.UIHandling.asmdef.meta +7 -0
  18. package/DialogueUIComponent.cs +81 -0
  19. package/DialogueUIComponent.cs.meta +11 -0
  20. package/EvaluateBoolCondition.cs +77 -0
  21. package/EvaluateBoolCondition.cs.meta +11 -0
  22. package/EvaluateCondition.cs +78 -0
  23. package/EvaluateCondition.cs.meta +11 -0
  24. package/EvaluateContextCondition.cs +44 -0
  25. package/EvaluateContextCondition.cs.meta +2 -0
  26. package/FadeCanvasGroupVisibility.cs +11 -0
  27. package/FadeCanvasGroupVisibility.cs.meta +11 -0
  28. package/FadeGraphicVisibility.cs +11 -0
  29. package/FadeGraphicVisibility.cs.meta +11 -0
  30. package/FadeHelper.cs +51 -0
  31. package/FadeHelper.cs.meta +11 -0
  32. package/FadeVisibility.cs +166 -0
  33. package/FadeVisibility.cs.meta +11 -0
  34. package/GlobalFadeUIVisibility.cs +44 -0
  35. package/GlobalFadeUIVisibility.cs.meta +11 -0
  36. package/HideDialogueUIHandler.cs +55 -0
  37. package/HideDialogueUIHandler.cs.meta +11 -0
  38. package/IModeVisibilityEntry.cs +22 -0
  39. package/IModeVisibilityEntry.cs.meta +2 -0
  40. package/ITrackableVisibility.cs +14 -0
  41. package/ITrackableVisibility.cs.meta +2 -0
  42. package/IUIVisibility.cs +26 -0
  43. package/IUIVisibility.cs.meta +11 -0
  44. package/IWaitAnimationCompleteOnLoad.cs +16 -0
  45. package/IWaitAnimationCompleteOnLoad.cs.meta +11 -0
  46. package/InSafeStateCondition.cs +59 -0
  47. package/InSafeStateCondition.cs.meta +11 -0
  48. package/LetterBoxCanvasHolder.cs +52 -0
  49. package/LetterBoxCanvasHolder.cs.meta +11 -0
  50. package/MatchBoolEventState.cs +43 -0
  51. package/MatchBoolEventState.cs.meta +11 -0
  52. package/MoveUIVisibility.cs +21 -0
  53. package/MoveUIVisibility.cs.meta +11 -0
  54. package/MultiUIVisibility.cs +129 -0
  55. package/MultiUIVisibility.cs.meta +11 -0
  56. package/OnModeVisibilityHandler.cs +40 -0
  57. package/OnModeVisibilityHandler.cs.meta +11 -0
  58. package/ProtagUIWindow.cs +100 -0
  59. package/ProtagUIWindow.cs.meta +11 -0
  60. package/Reticles/HoverReticle.cs +132 -0
  61. package/Reticles/HoverReticle.cs.meta +11 -0
  62. package/Reticles/ObjectNameOnReticle.cs +66 -0
  63. package/Reticles/ObjectNameOnReticle.cs.meta +11 -0
  64. package/Reticles/RaycastReticle.cs +264 -0
  65. package/Reticles/RaycastReticle.cs.meta +11 -0
  66. package/Reticles/Reticle.cs +197 -0
  67. package/Reticles/Reticle.cs.meta +11 -0
  68. package/Reticles/ReticleAnimationComponent.cs +144 -0
  69. package/Reticles/ReticleAnimationComponent.cs.meta +11 -0
  70. package/Reticles/ReticleComponent.cs +35 -0
  71. package/Reticles/ReticleComponent.cs.meta +11 -0
  72. package/Reticles/ReticleIconLayer.cs +27 -0
  73. package/Reticles/ReticleIconLayer.cs.meta +11 -0
  74. package/Reticles.meta +8 -0
  75. package/RotateUIVisibility.cs +29 -0
  76. package/RotateUIVisibility.cs.meta +2 -0
  77. package/Samples~/3DUIVisible.asset +21 -0
  78. package/Samples~/3DUIVisible.asset.meta +8 -0
  79. package/Samples~/Allow_Raycasting.prefab +64 -0
  80. package/Samples~/Allow_Raycasting.prefab.meta +7 -0
  81. package/Samples~/Dialogue_Load_Leave_Condition.prefab +61 -0
  82. package/Samples~/Dialogue_Load_Leave_Condition.prefab.meta +7 -0
  83. package/Samples~/Disable_On_FTE_Minigame.prefab +132 -0
  84. package/Samples~/Disable_On_FTE_Minigame.prefab.meta +7 -0
  85. package/Samples~/Enable_When_In_Leave_Process.prefab +142 -0
  86. package/Samples~/Enable_When_In_Leave_Process.prefab.meta +7 -0
  87. package/Samples~/FreezeUIVisible.asset +20 -0
  88. package/Samples~/FreezeUIVisible.asset.meta +8 -0
  89. package/Samples~/Freeze_UI_System.prefab +331 -0
  90. package/Samples~/Freeze_UI_System.prefab.meta +7 -0
  91. package/Samples~/Global_Fade_UI_Visibility.prefab +48 -0
  92. package/Samples~/Global_Fade_UI_Visibility.prefab.meta +7 -0
  93. package/Samples~/Hide_Dialogue_UI_Handler.prefab +139 -0
  94. package/Samples~/Hide_Dialogue_UI_Handler.prefab.meta +7 -0
  95. package/Samples~/Hide_Dialogue_UI_Handler_Shell.prefab +81 -0
  96. package/Samples~/Hide_Dialogue_UI_Handler_Shell.prefab.meta +7 -0
  97. package/Samples~/Hide_Instant_Dialogue_UI_Handler.prefab +86 -0
  98. package/Samples~/Hide_Instant_Dialogue_UI_Handler.prefab.meta +7 -0
  99. package/Samples~/In_Safe_State_Condition.prefab +56 -0
  100. package/Samples~/In_Safe_State_Condition.prefab.meta +7 -0
  101. package/Samples~/In_Safe_TPFD_State.prefab +59 -0
  102. package/Samples~/In_Safe_TPFD_State.prefab.meta +7 -0
  103. package/Samples~/OnFinishedRoomTransitions.asset +14 -0
  104. package/Samples~/OnFinishedRoomTransitions.asset.meta +8 -0
  105. package/Samples~/PlayHideDialogueSFX.asset +21 -0
  106. package/Samples~/PlayHideDialogueSFX.asset.meta +8 -0
  107. package/Samples~/PostPhaseChange.asset +14 -0
  108. package/Samples~/PostPhaseChange.asset.meta +8 -0
  109. package/Samples~/Post_Phase_Change_Listener.prefab +51 -0
  110. package/Samples~/Post_Phase_Change_Listener.prefab.meta +7 -0
  111. package/Samples~/PrePhaseChange.asset +14 -0
  112. package/Samples~/PrePhaseChange.asset.meta +8 -0
  113. package/Samples~/PrePhaseDialogueEnd.asset +14 -0
  114. package/Samples~/PrePhaseDialogueEnd.asset.meta +8 -0
  115. package/Samples~/Pre_Phase_Change_Listener.prefab +51 -0
  116. package/Samples~/Pre_Phase_Change_Listener.prefab.meta +7 -0
  117. package/Samples~/Pre_Phase_Dialogue_End_Listener.prefab +51 -0
  118. package/Samples~/Pre_Phase_Dialogue_End_Listener.prefab.meta +7 -0
  119. package/Samples~/ProtagUIVisible.asset +20 -0
  120. package/Samples~/ProtagUIVisible.asset.meta +8 -0
  121. package/Samples~/Show_Dialogue_UI_Handler.prefab +106 -0
  122. package/Samples~/Show_Dialogue_UI_Handler.prefab.meta +7 -0
  123. package/Samples~/Show_Dialogue_UI_Handler_Shell.prefab +87 -0
  124. package/Samples~/Show_Dialogue_UI_Handler_Shell.prefab.meta +7 -0
  125. package/Samples~/Show_Instant_Dialogue_UI_Handler.prefab +85 -0
  126. package/Samples~/Show_Instant_Dialogue_UI_Handler.prefab.meta +7 -0
  127. package/Samples~/Show_Reticle_On_Dialogue_Finish.prefab +98 -0
  128. package/Samples~/Show_Reticle_On_Dialogue_Finish.prefab.meta +7 -0
  129. package/Samples~/Show_Trial_Dialogue_UI_Handler.prefab +91 -0
  130. package/Samples~/Show_Trial_Dialogue_UI_Handler.prefab.meta +7 -0
  131. package/Samples~/Stop_Reticle_Confirm_Select_On_Dialogue_Finish.prefab +108 -0
  132. package/Samples~/Stop_Reticle_Confirm_Select_On_Dialogue_Finish.prefab.meta +7 -0
  133. package/Samples~/Toggle_Bool_With_Event.prefab +47 -0
  134. package/Samples~/Toggle_Bool_With_Event.prefab.meta +7 -0
  135. package/Samples~/Toggle_Protag_UI_On_Scene_Event.prefab +124 -0
  136. package/Samples~/Toggle_Protag_UI_On_Scene_Event.prefab.meta +7 -0
  137. package/Samples~/UIVisibility_On_Dialogue_Finish.prefab +51 -0
  138. package/Samples~/UIVisibility_On_Dialogue_Finish.prefab.meta +7 -0
  139. package/Samples~/UI_Visibility_By_Dialogue_Load_State.prefab +201 -0
  140. package/Samples~/UI_Visibility_By_Dialogue_Load_State.prefab.meta +7 -0
  141. package/Samples~/UI_Visibility_On_Bool_With_Event.prefab +57 -0
  142. package/Samples~/UI_Visibility_On_Bool_With_Event.prefab.meta +7 -0
  143. package/Samples~/UI_Visibility_On_Dialogue_Event.prefab +54 -0
  144. package/Samples~/UI_Visibility_On_Dialogue_Event.prefab.meta +7 -0
  145. package/Samples~/UI_Visibility_On_Inverse_Trial_Mode.prefab +142 -0
  146. package/Samples~/UI_Visibility_On_Inverse_Trial_Mode.prefab.meta +7 -0
  147. package/Samples~/UI_Visibility_On_Safe_State.prefab +198 -0
  148. package/Samples~/UI_Visibility_On_Safe_State.prefab.meta +7 -0
  149. package/Samples~/Video_Visibility_ETemplate.prefab +252 -0
  150. package/Samples~/Video_Visibility_ETemplate.prefab.meta +7 -0
  151. package/SetActiveVisibility.cs +42 -0
  152. package/SetActiveVisibility.cs.meta +11 -0
  153. package/ShowDialogueUIHandler.cs +113 -0
  154. package/ShowDialogueUIHandler.cs.meta +11 -0
  155. package/SizeDeltaVisibility.cs +113 -0
  156. package/SizeDeltaVisibility.cs.meta +11 -0
  157. package/SlidePositionVisibility.cs +178 -0
  158. package/SlidePositionVisibility.cs.meta +11 -0
  159. package/StateVisibilityEntry.cs +27 -0
  160. package/StateVisibilityEntry.cs.meta +2 -0
  161. package/ToggleTextVisibility.cs +60 -0
  162. package/ToggleTextVisibility.cs.meta +11 -0
  163. package/TransformUIVisibility.cs +173 -0
  164. package/TransformUIVisibility.cs.meta +2 -0
  165. package/UIVisibilityByDialogueLoadState.cs +94 -0
  166. package/UIVisibilityByDialogueLoadState.cs.meta +11 -0
  167. package/UIVisibilityComponent.cs +145 -0
  168. package/UIVisibilityComponent.cs.meta +11 -0
  169. package/UIVisibilityHandler.cs +40 -0
  170. package/UIVisibilityHandler.cs.meta +11 -0
  171. package/UIVisibilityOnBoolWithEvent.cs +105 -0
  172. package/UIVisibilityOnBoolWithEvent.cs.meta +11 -0
  173. package/UIVisibilityOnDialogueEvent.cs +69 -0
  174. package/UIVisibilityOnDialogueEvent.cs.meta +11 -0
  175. package/UIVisibilityOnDialogueFinish.cs +101 -0
  176. package/UIVisibilityOnDialogueFinish.cs.meta +11 -0
  177. package/UIVisibilityOnSafeState.cs +66 -0
  178. package/UIVisibilityOnSafeState.cs.meta +11 -0
  179. package/UIVisibilityOnSceneEvents.cs +53 -0
  180. package/UIVisibilityOnSceneEvents.cs.meta +11 -0
  181. package/UIVisibilityUtility.cs +39 -0
  182. package/UIVisibilityUtility.cs.meta +11 -0
  183. package/VideoVisibility.cs +108 -0
  184. package/VideoVisibility.cs.meta +11 -0
  185. package/VisibilityEntryBase.cs +44 -0
  186. package/VisibilityEntryBase.cs.meta +2 -0
  187. package/WaitForAnimationOnLoad.cs +46 -0
  188. package/WaitForAnimationOnLoad.cs.meta +11 -0
  189. package/package.json +40 -4
  190. package/package.json.meta +7 -0
  191. package/README.md +0 -3
Binary file
@@ -0,0 +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
+ }
129
+ }
@@ -0,0 +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:
@@ -0,0 +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
+ }
102
+ }
@@ -0,0 +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:
@@ -0,0 +1,103 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Services;
3
+ using System.Collections;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.UIHandling
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ [ClassHeader(nameof(UIVisibilityComponent) + ", " + nameof(IUIVisibility) + ", " + nameof(IToTitleScreen) +
12
+ "\n\n")]
13
+ public class CanvasUIVisibility : UIVisibilityComponent, IToTitleScreen
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [Tooltip("")]
19
+ [SerializeField] protected Canvas canvas = null;
20
+
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Header("")]
26
+ [Divider]
27
+ [Tooltip("")]
28
+ [SerializeField] protected bool debug = false;
29
+
30
+ /// <summary>
31
+ ///
32
+ /// </summary>
33
+ [Tooltip("")]
34
+ [SerializeField] protected bool setVisibilityOnTitleScreen = false;
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ [Tooltip("")]
40
+ [SerializeField] protected bool visibilityOnTitleScreen = false;
41
+
42
+
43
+ protected virtual void Awake() => CheckInitializeCanvas();
44
+
45
+ /// <summary>
46
+ ///
47
+ /// </summary>
48
+ protected virtual void CheckInitializeCanvas()
49
+ {
50
+ if (canvas == null)
51
+ TryGetComponent(out canvas);
52
+
53
+ if (canvas == null)
54
+ canvas = transform.parent.GetComponentInParent<Canvas>();
55
+ }
56
+
57
+
58
+ /// <inheritdoc/>
59
+ protected override void ShowUI() => SetCanvasTo(true);
60
+
61
+ /// <inheritdoc/>
62
+ protected override void HideUI() => SetCanvasTo(false);
63
+
64
+ /// <summary>
65
+ ///
66
+ /// </summary>
67
+ /// <param name="to"></param>
68
+ protected virtual void SetCanvasTo(bool to)
69
+ {
70
+ if (debug)
71
+ UnityEngine.Debug.LogWarning($"REPORT: Set Canvas {gameObject.name} to {to}.");
72
+
73
+ CheckInitializeCanvas();
74
+
75
+ canvas.enabled = to;
76
+ }
77
+
78
+ /// <inheritdoc/>
79
+ protected override IEnumerator WaitForUIToComplete()
80
+ {
81
+ yield break;
82
+ }
83
+
84
+ /// <inheritdoc/>
85
+ public virtual void ToTitleScreen()
86
+ {
87
+ if (setVisibilityOnTitleScreen)
88
+ ChangeVisibilityOnTitleScreen();
89
+ }
90
+
91
+ /// <summary>
92
+ ///
93
+ /// </summary>
94
+ protected virtual void ChangeVisibilityOnTitleScreen() => SetCanvasTo(visibilityOnTitleScreen);
95
+
96
+ /// <summary>
97
+ ///
98
+ /// </summary>
99
+ /// <param name="canvas"></param>
100
+ /// <remarks></remarks>
101
+ public void SetCanvas(Canvas canvas) => this.canvas = canvas;
102
+ }
103
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 1beb5a4cd7115484ba23198acfb8e042
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,20 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using UnityEngine;
3
+
4
+ namespace DREditor.UIHandling
5
+ {
6
+ /// <summary>
7
+ ///
8
+ /// </summary>
9
+ public class CenterReticleOnSafeState : ConditionOnSceneEvent
10
+ {
11
+ /// <summary>
12
+ ///
13
+ /// </summary>
14
+ [Tooltip("")]
15
+ [SerializeField] protected Transform reticle = null;
16
+
17
+ /// <inheritdoc/>
18
+ protected override void OnPassedCondition() => reticle.localPosition = Vector3.zero;
19
+ }
20
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 1866f9b32123dc2488abdd3398aeaccb
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,134 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if DOTWEEN
3
+ using DG.Tweening;
4
+ #endif
5
+ using System.Collections;
6
+ using System.Collections.Generic;
7
+ using UnityEngine;
8
+ using UnityEngine.UI;
9
+
10
+ namespace DREditor.UIHandling
11
+ {
12
+ /// <summary>
13
+ ///
14
+ /// </summary>
15
+ [ClassHeader(nameof(UIVisibilityComponent) +
16
+ "\n\n")]
17
+ public class ColorUIVisibility : UIVisibilityComponent
18
+ {
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ [Tooltip("")]
23
+ [SerializeField] protected List<Graphic> graphics = null;
24
+
25
+
26
+ /// <summary>
27
+ ///
28
+ /// </summary>
29
+ [Header("")]
30
+ [Divider]
31
+ [Tooltip("")]
32
+ [SerializeField] protected Color showColor = new();
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected float colorShowDuration = 0.5f;
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ [Tooltip("")]
44
+ [SerializeField] protected Color hideColor = new();
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ [Tooltip("")]
50
+ [SerializeField] protected float colorHideDuration = 0.5f;
51
+
52
+
53
+ /// <summary>
54
+ ///
55
+ /// </summary>
56
+ [Header("")]
57
+ [Divider]
58
+ [Tooltip("")]
59
+ [SerializeField] protected bool ignoreTimeScale = false;
60
+ #if DOTWEEN
61
+ /// <summary>
62
+ ///
63
+ /// </summary>
64
+ [Tooltip("")]
65
+ [SerializeField] protected Ease easeCurve = Ease.Linear;
66
+ #endif
67
+ /// <summary>
68
+ ///
69
+ /// </summary>
70
+ [Tooltip("")]
71
+ [SerializeField] protected int loops = 0;
72
+
73
+ /// <summary>
74
+ ///
75
+ /// </summary>
76
+ [Tooltip("")]
77
+ [SerializeField] protected float delay = 0f;
78
+
79
+ #if DOTWEEN
80
+ /// <summary>
81
+ ///
82
+ /// </summary>
83
+ protected List<Tween> activeTweens = new();
84
+ #endif
85
+
86
+ /// <inheritdoc/>
87
+ protected override void ShowUI()
88
+ {
89
+ #if DOTWEEN
90
+ graphics.ForEach(component =>
91
+ RegisterTween(component.DOColor(showColor, colorShowDuration)
92
+ .SetUpdate(ignoreTimeScale)
93
+ .SetEase(easeCurve)
94
+ .SetLoops(loops)
95
+ .SetDelay(delay))
96
+ );
97
+ #endif
98
+ }
99
+
100
+ /// <inheritdoc/>
101
+ protected override void HideUI()
102
+ {
103
+ #if DOTWEEN
104
+ graphics.ForEach(component =>
105
+ RegisterTween(component.DOColor(hideColor, colorHideDuration)
106
+ .SetUpdate(ignoreTimeScale)
107
+ .SetEase(easeCurve)
108
+ .SetLoops(loops)
109
+ .SetDelay(delay))
110
+ );
111
+ #endif
112
+ }
113
+ #if DOTWEEN
114
+ /// <summary>
115
+ ///
116
+ /// </summary>
117
+ /// <param name="tween"></param>
118
+ protected virtual void RegisterTween(Tween tween)
119
+ {
120
+ tween.onComplete = () => { activeTweens.Remove(tween); };
121
+
122
+ activeTweens.Add(tween);
123
+ }
124
+ #endif
125
+ /// <inheritdoc/>
126
+ protected override IEnumerator WaitForUIToComplete()
127
+ {
128
+ #if DOTWEEN
129
+ while (activeTweens.Count != 0)
130
+ #endif
131
+ yield return null;
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,2 @@
1
+ fileFormatVersion: 2
2
+ guid: 337b1cd779f3d3d41865ba7b02c1d5d4
@@ -0,0 +1,43 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.EventObjects;
3
+ using UnityEngine;
4
+
5
+ namespace DREditor.UIHandling
6
+ {
7
+ /// <summary>
8
+ ///
9
+ /// </summary>
10
+ public abstract class ConditionOnSceneEvent : SceneEventListener
11
+ {
12
+ /// <summary>
13
+ ///
14
+ /// </summary>
15
+ [Header("")]
16
+
17
+ [Tooltip("")]
18
+ [SerializeField] protected EvaluateCondition condition = null;
19
+
20
+
21
+ /// <inheritdoc/>
22
+ public override void OnEventRaised()
23
+ {
24
+ base.OnEventRaised();
25
+
26
+ OnCheckCondition();
27
+ }
28
+
29
+ /// <summary>
30
+ ///
31
+ /// </summary>
32
+ protected virtual void OnCheckCondition()
33
+ {
34
+ if (condition == null || condition.Evaluate())
35
+ OnPassedCondition();
36
+ }
37
+
38
+ /// <summary>
39
+ ///
40
+ /// </summary>
41
+ protected abstract void OnPassedCondition();
42
+ }
43
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0a32de5c46927e744b5f4ea7a349c511
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,33 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System;
3
+ using UnityEngine;
4
+
5
+ namespace DREditor.UIHandling
6
+ {
7
+ /// <summary>
8
+ ///
9
+ /// </summary>
10
+ [Serializable]
11
+ public class ConditionVisibilityEntry : VisibilityEntryBase
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [Tooltip("")]
17
+ [SerializeField] protected EvaluateCondition condition;
18
+
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ [Tooltip("")]
23
+ [SerializeField] protected bool invert = false;
24
+
25
+
26
+ /// <inheritdoc/>
27
+ protected override void EvaluateInState(bool inState)
28
+ {
29
+ if (condition != null && condition.Evaluate())
30
+ setVisibility(invert ? inState : !inState);
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,2 @@
1
+ fileFormatVersion: 2
2
+ guid: 5a7ddba913022884c87f6430ec928dc7
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "DREditor.UIHandling",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "Unity.TextMeshPro",
6
+ "Unity.InputSystem",
7
+ "DREditor",
8
+ "DREditor.Controls",
9
+ "DREditor.Fading",
10
+ "DG.Tweening"
11
+ ],
12
+ "includePlatforms": [],
13
+ "excludePlatforms": [],
14
+ "allowUnsafeCode": false,
15
+ "overrideReferences": false,
16
+ "precompiledReferences": [],
17
+ "autoReferenced": true,
18
+ "defineConstraints": [],
19
+ "versionDefines": [],
20
+ "noEngineReferences": false
21
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 129f5e48f1af4c946af372b8cb81568d
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant: