net.dreditor.dialogueeventhandling 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 (82) hide show
  1. package/.attestation.p7m +0 -0
  2. package/AnimationEventHandler.cs +187 -187
  3. package/AnimationEventHandler.cs.meta +11 -11
  4. package/CameraEvents/CamToPositionEvent.cs +286 -286
  5. package/CameraEvents/CamToPositionEvent.cs.meta +11 -11
  6. package/CameraEvents/CamerasToTPFDPosition.cs +71 -71
  7. package/CameraEvents/CamerasToTPFDPosition.cs.meta +11 -11
  8. package/CameraEvents/CaptureFrameEvent.cs +60 -60
  9. package/CameraEvents/CaptureFrameEvent.cs.meta +11 -11
  10. package/CameraEvents/CaptureFrameProtag.cs +40 -40
  11. package/CameraEvents/CaptureFrameProtag.cs.meta +11 -11
  12. package/CameraEvents/EnableCameraEvent.cs +39 -39
  13. package/CameraEvents/EnableCameraEvent.cs.meta +11 -11
  14. package/CameraEvents/EnableCamerasOnSceneEvent.cs +46 -46
  15. package/CameraEvents/EnableCamerasOnSceneEvent.cs.meta +11 -11
  16. package/CameraEvents/MoveCameraToCamera.cs +66 -66
  17. package/CameraEvents/MoveCameraToCamera.cs.meta +11 -11
  18. package/CameraEvents/PrepareCamerasTPFD.cs +68 -68
  19. package/CameraEvents/PrepareCamerasTPFD.cs.meta +11 -11
  20. package/CameraEvents/ResetCameraPosition.cs +59 -59
  21. package/CameraEvents/ResetCameraPosition.cs.meta +11 -11
  22. package/CameraEvents/SetDialogueCameraEvent.cs +31 -31
  23. package/CameraEvents/SetDialogueCameraEvent.cs.meta +11 -11
  24. package/CameraEvents/ShakeCameraEvent.cs +171 -171
  25. package/CameraEvents/ShakeCameraEvent.cs.meta +11 -11
  26. package/CameraEvents/ToggleBlurHandler.cs +36 -36
  27. package/CameraEvents/ToggleBlurHandler.cs.meta +1 -1
  28. package/CameraEvents/ToggleCameraFlagsEvent.cs +54 -54
  29. package/CameraEvents/ToggleCameraFlagsEvent.cs.meta +11 -11
  30. package/CameraEvents.meta +8 -8
  31. package/ChangeSelectabilityEvent.cs +46 -46
  32. package/ChangeSelectabilityEvent.cs.meta +11 -11
  33. package/CharacterIntroAnim.cs +214 -214
  34. package/CharacterIntroAnim.cs.meta +11 -11
  35. package/CustomDialogueEventHandler.cs +31 -31
  36. package/CustomDialogueEventHandler.cs.meta +11 -11
  37. package/DREditor.DialogueEventHandling.asmdef +20 -20
  38. package/DREditor.DialogueEventHandling.asmdef.meta +7 -7
  39. package/DialogueEventHandler.cs +54 -54
  40. package/DialogueEventHandler.cs.meta +11 -11
  41. package/DialogueMidEntranceDebugger.cs +87 -87
  42. package/DialogueMidEntranceDebugger.cs.meta +11 -11
  43. package/Flashing/FlashEventHandlerBase.cs +114 -114
  44. package/Flashing/FlashEventHandlerBase.cs.meta +11 -11
  45. package/Flashing/FlashEventSimpleHandlerBase.cs +34 -34
  46. package/Flashing/FlashEventSimpleHandlerBase.cs.meta +1 -1
  47. package/Flashing/FlashScreenWhiteEvent.cs +59 -59
  48. package/Flashing/FlashScreenWhiteEvent.cs.meta +11 -11
  49. package/Flashing/FlashWhiteMat.mat +141 -141
  50. package/Flashing/FlashWhiteMat.mat.meta +8 -8
  51. package/Flashing/FlashWhiteShader.shadergraph +1170 -1170
  52. package/Flashing/FlashWhiteShader.shadergraph.meta +10 -10
  53. package/Flashing/FlashWhiteSpriteEventHandler.cs +137 -137
  54. package/Flashing/FlashWhiteSpriteEventHandler.cs.meta +11 -11
  55. package/Flashing/ProtagFlashWhiteEventHandler.cs +221 -221
  56. package/Flashing/ProtagFlashWhiteEventHandler.cs.meta +11 -11
  57. package/Flashing.meta +8 -8
  58. package/PanToObjectEvent.cs +83 -83
  59. package/PanToObjectEvent.cs.meta +11 -11
  60. package/PlayerManager.cs +207 -207
  61. package/PlayerManager.cs.meta +11 -11
  62. package/{Samples → Samples~}/Actor_Fade_Dialogue_Event.prefab +47 -47
  63. package/{Samples → Samples~}/Actor_Fade_Dialogue_Event.prefab.meta +7 -7
  64. package/{Samples → Samples~}/Change_Selectability_Event.prefab +47 -47
  65. package/{Samples → Samples~}/Change_Selectability_Event.prefab.meta +7 -7
  66. package/{Samples → Samples~}/Character_Intro_Canvas_ETemplate.prefab +134 -134
  67. package/{Samples → Samples~}/Character_Intro_Canvas_ETemplate.prefab.meta +7 -7
  68. package/{Samples → Samples~}/DialogueMidEntranceDebugger.prefab +48 -48
  69. package/{Samples → Samples~}/DialogueMidEntranceDebugger.prefab.meta +7 -7
  70. package/{Samples → Samples~}/Flash_Screen_White_Line_Handler.prefab +47 -47
  71. package/{Samples → Samples~}/Flash_Screen_White_Line_Handler.prefab.meta +7 -7
  72. package/{Samples → Samples~}/Flash_Sprite_Event_Handler.prefab +58 -58
  73. package/{Samples → Samples~}/Flash_Sprite_Event_Handler.prefab.meta +7 -7
  74. package/{Samples → Samples~}/Protag_Flash_Line_Handler.prefab +47 -47
  75. package/{Samples → Samples~}/Protag_Flash_Line_Handler.prefab.meta +7 -7
  76. package/{Samples → Samples~}/Sprite_Flash_Line_Handler.prefab +48 -48
  77. package/{Samples → Samples~}/Sprite_Flash_Line_Handler.prefab.meta +7 -7
  78. package/ShakeUIEvent.cs +53 -53
  79. package/ShakeUIEvent.cs.meta +11 -11
  80. package/package.json +42 -37
  81. package/package.json.meta +7 -7
  82. package/Samples.meta +0 -8
Binary file
@@ -1,188 +1,188 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.EventObjects;
3
- using System.Collections;
4
- using UnityEngine;
5
- using AnimationEvent = DREditor.Dialogues.Events.AnimationEvent;
6
-
7
- namespace DREditor.DialogueEventHandling
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- public class AnimationEventHandler : DialogueEventHandler
13
- {
14
- /// <summary>
15
- ///
16
- /// </summary>
17
- [Header("")]
18
- [Divider]
19
- [Tooltip("")]
20
- [SerializeField] protected bool debugLogs = false;
21
-
22
-
23
- /// <summary>
24
- ///
25
- /// </summary>
26
- [Header("")]
27
- [Divider]
28
- [Tooltip("")]
29
- [SerializeField] protected Animator animator = null;
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- [Tooltip("")]
35
- [SerializeField] protected int animatorLayer = 0;
36
-
37
- /// <summary>
38
- ///
39
- /// </summary>
40
- [Tooltip("")]
41
- [SerializeField] protected BoolWithEvent isLoadingFile = null;
42
-
43
-
44
- /// <summary>
45
- ///
46
- /// </summary>
47
- [Header("")]
48
- [Divider]
49
- [Tooltip("")]
50
- [SerializeField] protected string oneShotAnimName = "";
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- [Tooltip("")]
56
- [SerializeField] protected bool DestroyOnLoadFile = true;
57
-
58
- /// <summary>
59
- ///
60
- /// </summary>
61
- [Tooltip("")]
62
- [SerializeField] protected Animation clip = null;
63
-
64
- /// <summary>
65
- ///
66
- /// </summary>
67
- [Tooltip("")]
68
- [SerializeField] protected bool waitForClipEnd = true;
69
-
70
- /// <summary>
71
- ///
72
- /// </summary>
73
- [Tooltip("")]
74
- [SerializeField] protected bool DestroyOnEnd = false;
75
-
76
-
77
- /// <inheritdoc/>
78
- protected override void OnDialogueEventTriggered(object o = null) => OnAnimationEventTriggered(o);
79
-
80
- /// <summary>
81
- ///
82
- /// </summary>
83
- /// <param name="o"></param>
84
- protected virtual void OnAnimationEventTriggered(object o = null)
85
- {
86
- if (debugLogs)
87
- UnityEngine.Debug.Log($"{ToString()}: " + dialogueEventString + " was called.");
88
-
89
- if (isLoadingFile.Value)
90
- OnLoadingFile((AnimationEvent)o);
91
- else
92
- OnAnimationEvent((AnimationEvent)o);
93
- }
94
-
95
- /// <summary>
96
- ///
97
- /// </summary>
98
- /// <param name="animationEvent"></param>
99
- protected virtual void OnLoadingFile(AnimationEvent animationEvent)
100
- {
101
- if (DestroyOnLoadFile)
102
- Destroy(gameObject);
103
- else if (clip != null)
104
- CallClip(animationEvent);
105
- }
106
-
107
- /// <summary>
108
- ///
109
- /// </summary>
110
- /// <param name="animationEvent"></param>
111
- protected virtual void OnAnimationEvent(AnimationEvent animationEvent)
112
- {
113
- if (clip != null)
114
- CallClip(animationEvent);
115
- else
116
- StartCoroutine(AnimationRoutine(animationEvent));
117
- }
118
-
119
- /// <summary>
120
- ///
121
- /// </summary>
122
- /// <param name="animationEvent"></param>
123
- /// <returns></returns>
124
- protected virtual IEnumerator AnimationRoutine(AnimationEvent animationEvent)
125
- {
126
- if (debugLogs)
127
- UnityEngine.Debug.Log($"{ToString()}: Starting Animation Routine");
128
-
129
- if (debugLogs && oneShotAnimName != "")
130
- UnityEngine.Debug.Log($"{ToString()}: calling one-shot animation: " + oneShotAnimName);
131
-
132
- if (oneShotAnimName != "")
133
- animator.Play(oneShotAnimName);
134
-
135
-
136
- float aLength = animator.GetCurrentAnimatorStateInfo(animatorLayer).length;
137
-
138
- if (!float.IsPositiveInfinity(aLength))
139
- yield return new WaitUntil(() =>
140
- animator.GetCurrentAnimatorStateInfo(animatorLayer).normalizedTime > 1.0f);
141
-
142
-
143
- animationEvent.SetFinished();
144
-
145
- if (debugLogs)
146
- UnityEngine.Debug.Log($"{ToString()}: Finished animation event: " + dialogueEventString);
147
- }
148
-
149
- /// <summary>
150
- ///
151
- /// </summary>
152
- /// <param name="animationEvent"></param>
153
- protected virtual void CallClip(AnimationEvent animationEvent)
154
- {
155
- clip.Play();
156
-
157
- if (waitForClipEnd)
158
- StartCoroutine(WaitForClip(animationEvent));
159
- else
160
- animationEvent.SetFinished();
161
- }
162
-
163
- /// <summary>
164
- ///
165
- /// </summary>
166
- /// <param name="animationEvent"></param>
167
- protected virtual IEnumerator WaitForClip(AnimationEvent animationEvent)
168
- {
169
- yield return new WaitForSeconds(clip.clip.length);
170
-
171
- animationEvent.SetFinished();
172
-
173
- if (DestroyOnEnd)
174
- Destroy(gameObject);
175
- }
176
-
177
-
178
- /// <summary>
179
- ///
180
- /// </summary>
181
- [BehaviourButton]
182
- public void TestAnimation()
183
- {
184
- if (Application.isPlaying)
185
- OnAnimationEventTriggered(new AnimationEvent(dialogueEventString));
186
- }
187
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.EventObjects;
3
+ using System.Collections;
4
+ using UnityEngine;
5
+ using AnimationEvent = DREditor.Dialogues.Events.AnimationEvent;
6
+
7
+ namespace DREditor.DialogueEventHandling
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ public class AnimationEventHandler : DialogueEventHandler
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ [Header("")]
18
+ [Divider]
19
+ [Tooltip("")]
20
+ [SerializeField] protected bool debugLogs = false;
21
+
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ [Header("")]
27
+ [Divider]
28
+ [Tooltip("")]
29
+ [SerializeField] protected Animator animator = null;
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ [Tooltip("")]
35
+ [SerializeField] protected int animatorLayer = 0;
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ [Tooltip("")]
41
+ [SerializeField] protected BoolWithEvent isLoadingFile = null;
42
+
43
+
44
+ /// <summary>
45
+ ///
46
+ /// </summary>
47
+ [Header("")]
48
+ [Divider]
49
+ [Tooltip("")]
50
+ [SerializeField] protected string oneShotAnimName = "";
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ [Tooltip("")]
56
+ [SerializeField] protected bool DestroyOnLoadFile = true;
57
+
58
+ /// <summary>
59
+ ///
60
+ /// </summary>
61
+ [Tooltip("")]
62
+ [SerializeField] protected Animation clip = null;
63
+
64
+ /// <summary>
65
+ ///
66
+ /// </summary>
67
+ [Tooltip("")]
68
+ [SerializeField] protected bool waitForClipEnd = true;
69
+
70
+ /// <summary>
71
+ ///
72
+ /// </summary>
73
+ [Tooltip("")]
74
+ [SerializeField] protected bool DestroyOnEnd = false;
75
+
76
+
77
+ /// <inheritdoc/>
78
+ protected override void OnDialogueEventTriggered(object o = null) => OnAnimationEventTriggered(o);
79
+
80
+ /// <summary>
81
+ ///
82
+ /// </summary>
83
+ /// <param name="o"></param>
84
+ protected virtual void OnAnimationEventTriggered(object o = null)
85
+ {
86
+ if (debugLogs)
87
+ UnityEngine.Debug.Log($"{ToString()}: " + dialogueEventString + " was called.");
88
+
89
+ if (isLoadingFile.Value)
90
+ OnLoadingFile((AnimationEvent)o);
91
+ else
92
+ OnAnimationEvent((AnimationEvent)o);
93
+ }
94
+
95
+ /// <summary>
96
+ ///
97
+ /// </summary>
98
+ /// <param name="animationEvent"></param>
99
+ protected virtual void OnLoadingFile(AnimationEvent animationEvent)
100
+ {
101
+ if (DestroyOnLoadFile)
102
+ Destroy(gameObject);
103
+ else if (clip != null)
104
+ CallClip(animationEvent);
105
+ }
106
+
107
+ /// <summary>
108
+ ///
109
+ /// </summary>
110
+ /// <param name="animationEvent"></param>
111
+ protected virtual void OnAnimationEvent(AnimationEvent animationEvent)
112
+ {
113
+ if (clip != null)
114
+ CallClip(animationEvent);
115
+ else
116
+ StartCoroutine(AnimationRoutine(animationEvent));
117
+ }
118
+
119
+ /// <summary>
120
+ ///
121
+ /// </summary>
122
+ /// <param name="animationEvent"></param>
123
+ /// <returns></returns>
124
+ protected virtual IEnumerator AnimationRoutine(AnimationEvent animationEvent)
125
+ {
126
+ if (debugLogs)
127
+ UnityEngine.Debug.Log($"{ToString()}: Starting Animation Routine");
128
+
129
+ if (debugLogs && oneShotAnimName != "")
130
+ UnityEngine.Debug.Log($"{ToString()}: calling one-shot animation: " + oneShotAnimName);
131
+
132
+ if (oneShotAnimName != "")
133
+ animator.Play(oneShotAnimName);
134
+
135
+
136
+ float aLength = animator.GetCurrentAnimatorStateInfo(animatorLayer).length;
137
+
138
+ if (!float.IsPositiveInfinity(aLength))
139
+ yield return new WaitUntil(() =>
140
+ animator.GetCurrentAnimatorStateInfo(animatorLayer).normalizedTime > 1.0f);
141
+
142
+
143
+ animationEvent.SetFinished();
144
+
145
+ if (debugLogs)
146
+ UnityEngine.Debug.Log($"{ToString()}: Finished animation event: " + dialogueEventString);
147
+ }
148
+
149
+ /// <summary>
150
+ ///
151
+ /// </summary>
152
+ /// <param name="animationEvent"></param>
153
+ protected virtual void CallClip(AnimationEvent animationEvent)
154
+ {
155
+ clip.Play();
156
+
157
+ if (waitForClipEnd)
158
+ StartCoroutine(WaitForClip(animationEvent));
159
+ else
160
+ animationEvent.SetFinished();
161
+ }
162
+
163
+ /// <summary>
164
+ ///
165
+ /// </summary>
166
+ /// <param name="animationEvent"></param>
167
+ protected virtual IEnumerator WaitForClip(AnimationEvent animationEvent)
168
+ {
169
+ yield return new WaitForSeconds(clip.clip.length);
170
+
171
+ animationEvent.SetFinished();
172
+
173
+ if (DestroyOnEnd)
174
+ Destroy(gameObject);
175
+ }
176
+
177
+
178
+ /// <summary>
179
+ ///
180
+ /// </summary>
181
+ [BehaviourButton]
182
+ public void TestAnimation()
183
+ {
184
+ if (Application.isPlaying)
185
+ OnAnimationEventTriggered(new AnimationEvent(dialogueEventString));
186
+ }
187
+ }
188
188
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: c40391447219bf042831fc83dfcee30a
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: c40391447219bf042831fc83dfcee30a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: