net.dreditor.minigames.nsd 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.
- package/.attestation.p7m +0 -0
- package/DREditor.Minigames.NSD.asmdef +37 -37
- package/DREditor.Minigames.NSD.asmdef.meta +7 -7
- package/Editor/DREditor.Minigames.NSD.Editor.asmdef +23 -23
- package/Editor/DREditor.Minigames.NSD.Editor.asmdef.meta +7 -7
- package/Editor/MenuItemNSDUtility.cs +127 -127
- package/Editor/MenuItemNSDUtility.cs.meta +11 -11
- package/Editor/NSDBuilderEditor.cs +184 -184
- package/Editor/NSDBuilderEditor.cs.meta +11 -11
- package/Editor.meta +8 -8
- package/Managers/ManuallyRenderCamera.cs +39 -39
- package/Managers/ManuallyRenderCamera.cs.meta +11 -11
- package/Managers/NSDBuilder.cs +56 -56
- package/Managers/NSDBuilder.cs.meta +11 -11
- package/Managers/NSDBulletLoadAnimation.cs +339 -339
- package/Managers/NSDBulletLoadAnimation.cs.meta +11 -11
- package/Managers/NSDIntro.cs +257 -257
- package/Managers/NSDIntro.cs.meta +11 -11
- package/Managers/NSDManager.cs +121 -121
- package/Managers/NSDManager.cs.meta +11 -11
- package/Managers/NSDReticle.cs +233 -233
- package/Managers/NSDReticle.cs.meta +11 -11
- package/Managers/OverlayBlend.shader +55 -55
- package/Managers/OverlayBlend.shader.meta +10 -10
- package/Managers.meta +8 -8
- package/{Samples → Samples~}/Absorb_Bullet_Mode_Mechanic_Template.prefab +939 -939
- package/{Samples → Samples~}/Absorb_Bullet_Mode_Mechanic_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDReticleHover.anim +179 -179
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDReticleHover.anim.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDReticleShow.anim +116 -116
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDReticleShow.anim.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDReticleSpin.anim +199 -199
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDReticleSpin.anim.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDUIRingLoop.anim +345 -345
- package/{Samples → Samples~}/Animations/NSD_Reticle/NSDUIRingLoop.anim.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Reticle/Reticle.controller +835 -835
- package/{Samples → Samples~}/Animations/NSD_Reticle/Reticle.controller.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Reticle.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Selection/NSDSelectionPieces.anim +791 -791
- package/{Samples → Samples~}/Animations/NSD_Selection/NSDSelectionPieces.anim.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Selection/Selection UI.controller +130 -130
- package/{Samples → Samples~}/Animations/NSD_Selection/Selection UI.controller.meta +8 -8
- package/{Samples → Samples~}/Animations/NSD_Selection.meta +8 -8
- package/{Samples → Samples~}/Animations.meta +8 -8
- package/{Samples → Samples~}/Bullet_Canvas_Shell.prefab +193 -193
- package/{Samples → Samples~}/Bullet_Canvas_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Bullet_Canvas_Template.prefab +348 -348
- package/{Samples → Samples~}/Bullet_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Bullet_Chamber_Shell.prefab +178 -178
- package/{Samples → Samples~}/Bullet_Chamber_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Bullet_Chamber_Template.prefab +280 -280
- package/{Samples → Samples~}/Bullet_Chamber_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Bullet_UI_Parent_Shell.prefab +38 -38
- package/{Samples → Samples~}/Bullet_UI_Parent_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Bullet_UI_Parent_Template.prefab +510 -510
- package/{Samples → Samples~}/Bullet_UI_Parent_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Can_Absorb_Condition.prefab +61 -61
- package/{Samples → Samples~}/Can_Absorb_Condition.prefab.meta +7 -7
- package/{Samples → Samples~}/Debate_Controls_UI_Condition.prefab +56 -56
- package/{Samples → Samples~}/Debate_Controls_UI_Condition.prefab.meta +7 -7
- package/{Samples → Samples~}/Debate_Text_Camera.prefab +125 -125
- package/{Samples → Samples~}/Debate_Text_Camera.prefab.meta +7 -7
- package/{Samples → Samples~}/Debate_Text_Texture.prefab +119 -119
- package/{Samples → Samples~}/Debate_Text_Texture.prefab.meta +7 -7
- package/{Samples → Samples~}/Firing_Bullet_Texture.prefab +75 -75
- package/{Samples → Samples~}/Firing_Bullet_Texture.prefab.meta +7 -7
- package/{Samples → Samples~}/Load_Bullet_ETemplate.prefab +343 -343
- package/{Samples → Samples~}/Load_Bullet_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Loading_Bullet_Canvas_ETemplate.prefab +405 -405
- package/{Samples → Samples~}/Loading_Bullet_Canvas_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/NSDUICameraEnabled.asset +21 -21
- package/{Samples → Samples~}/NSDUICameraEnabled.asset.meta +8 -8
- package/{Samples → Samples~}/NSD_Controls_UI_Handler.prefab +168 -168
- package/{Samples → Samples~}/NSD_Controls_UI_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Intro_Canvas_ETemplate.prefab +272 -272
- package/{Samples → Samples~}/NSD_Intro_Canvas_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Intro_Shell.prefab +60 -60
- package/{Samples → Samples~}/NSD_Intro_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Intro_Template.prefab +248 -248
- package/{Samples → Samples~}/NSD_Intro_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Line_Manager.prefab +271 -271
- package/{Samples → Samples~}/NSD_Line_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Manager_Shell.prefab +313 -313
- package/{Samples → Samples~}/NSD_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Manager_Template.prefab +2078 -2078
- package/{Samples → Samples~}/NSD_Manager_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_Reticle_ETemplate.prefab +314 -314
- package/{Samples → Samples~}/NSD_Reticle_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_UI_Camera.prefab +158 -158
- package/{Samples → Samples~}/NSD_UI_Camera.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_UI_Canvas_Shell.prefab +481 -481
- package/{Samples → Samples~}/NSD_UI_Canvas_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_UI_Canvas_Template.prefab +603 -603
- package/{Samples → Samples~}/NSD_UI_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/NSD_UI_Texture.prefab +75 -75
- package/{Samples → Samples~}/NSD_UI_Texture.prefab.meta +7 -7
- package/{Samples → Samples~}/White Noise Triangle Shatter.asset +31 -31
- package/{Samples → Samples~}/White Noise Triangle Shatter.asset.meta +8 -8
- package/package.json +57 -52
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 923e754c6c2991f48b4b51f7722bf138
|
|
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: 923e754c6c2991f48b4b51f7722bf138
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Managers/NSDIntro.cs
CHANGED
|
@@ -1,258 +1,258 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
#if DOTWEEN
|
|
3
|
-
using DG.Tweening;
|
|
4
|
-
#endif
|
|
5
|
-
using DREditor.Cameras;
|
|
6
|
-
using DREditor.Dialogues;
|
|
7
|
-
using DREditor.UIHandling;
|
|
8
|
-
using System.Collections;
|
|
9
|
-
using System.Linq;
|
|
10
|
-
using UnityEngine;
|
|
11
|
-
using UnityEngine.Events;
|
|
12
|
-
using UnityEngine.Rendering;
|
|
13
|
-
using UnityEngine.UI;
|
|
14
|
-
|
|
15
|
-
namespace DREditor.Minigames.NSD.Managers
|
|
16
|
-
{
|
|
17
|
-
//I commented the process so that it'd be easier for others to understand the sequence of events,
|
|
18
|
-
//not that the code doesn't explain it well enough already.
|
|
19
|
-
/// <summary>
|
|
20
|
-
///
|
|
21
|
-
/// </summary>
|
|
22
|
-
[ClassHeader(nameof(UIVisibilityComponent) + ", " + nameof(IUIVisibility) +
|
|
23
|
-
"\n\n")]
|
|
24
|
-
public class NSDIntro : UIVisibilityComponent
|
|
25
|
-
{
|
|
26
|
-
/// <summary>
|
|
27
|
-
///
|
|
28
|
-
/// </summary>
|
|
29
|
-
[Header("")]
|
|
30
|
-
[Divider]
|
|
31
|
-
[Tooltip("")]
|
|
32
|
-
[SerializeField] protected string transitionCameraAnimationName = "NSD-transition";
|
|
33
|
-
|
|
34
|
-
/// <summary>
|
|
35
|
-
///
|
|
36
|
-
/// </summary>
|
|
37
|
-
[Tooltip("")]
|
|
38
|
-
[SerializeField] protected Image transitionBlackFade = null;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/// <summary>
|
|
42
|
-
///
|
|
43
|
-
/// </summary>
|
|
44
|
-
[Header("")]
|
|
45
|
-
[Divider]
|
|
46
|
-
[Tooltip("")]
|
|
47
|
-
[SerializeField] protected float divideOpeningCameraAnimationLength = 1.5f;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/// <summary>
|
|
51
|
-
///
|
|
52
|
-
/// </summary>
|
|
53
|
-
[Header("")]
|
|
54
|
-
[Divider]
|
|
55
|
-
[Range(0, 1)]
|
|
56
|
-
[Tooltip("")]
|
|
57
|
-
[SerializeField] protected float transitionFadeToValue = 1;
|
|
58
|
-
|
|
59
|
-
/// <summary>
|
|
60
|
-
///
|
|
61
|
-
/// </summary>
|
|
62
|
-
[Tooltip("")]
|
|
63
|
-
[SerializeField] protected float transitionFadeToDuration = 1;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/// <summary>
|
|
67
|
-
///
|
|
68
|
-
/// </summary>
|
|
69
|
-
[Header("")]
|
|
70
|
-
[Divider]
|
|
71
|
-
[Range(0, 1)]
|
|
72
|
-
[Tooltip("")]
|
|
73
|
-
[SerializeField] protected float transitionFadeOutValue = 0;
|
|
74
|
-
|
|
75
|
-
/// <summary>
|
|
76
|
-
///
|
|
77
|
-
/// </summary>
|
|
78
|
-
[Tooltip("")]
|
|
79
|
-
[SerializeField] protected float transitionFadeOutDuration = 0.5f;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/// <summary>
|
|
83
|
-
///
|
|
84
|
-
/// </summary>
|
|
85
|
-
[Header("")]
|
|
86
|
-
[Divider]
|
|
87
|
-
[Tooltip("")]
|
|
88
|
-
[SerializeField] protected string openingCameraAnimationName = "NSD-intro";
|
|
89
|
-
|
|
90
|
-
/// <summary>
|
|
91
|
-
///
|
|
92
|
-
/// </summary>
|
|
93
|
-
[Tooltip("")]
|
|
94
|
-
[SerializeField] protected UIVisibilityComponent openingAnimator = null;
|
|
95
|
-
|
|
96
|
-
/// <summary>
|
|
97
|
-
///
|
|
98
|
-
/// </summary>
|
|
99
|
-
[Tooltip("")]
|
|
100
|
-
[SerializeField] protected float openingAnimationAdditionalWaitTime = 4;
|
|
101
|
-
|
|
102
|
-
/// <summary>
|
|
103
|
-
///
|
|
104
|
-
/// </summary>
|
|
105
|
-
[Tooltip("")]
|
|
106
|
-
[SerializeField] protected VolumeProfile volumeProfile = null;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
[Header("")]
|
|
110
|
-
[SerializeField] protected UnityEvent onPlayIntroSound = null;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/// <summary>
|
|
114
|
-
///
|
|
115
|
-
/// </summary>
|
|
116
|
-
protected DRTrialCamera trialCameraDR = null;
|
|
117
|
-
|
|
118
|
-
/// <summary>
|
|
119
|
-
///
|
|
120
|
-
/// </summary>
|
|
121
|
-
protected Volume volume = null;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
protected virtual void Start()
|
|
125
|
-
{
|
|
126
|
-
trialCameraDR = FindAnyObjectByType<DRTrialCamera>();
|
|
127
|
-
|
|
128
|
-
if (volumeProfile != null)
|
|
129
|
-
volume = FindObjectsByType<Volume>()
|
|
130
|
-
.Where(foundVolume => foundVolume.profile.name == volumeProfile.name)
|
|
131
|
-
.FirstOrDefault();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/// <inheritdoc/>
|
|
135
|
-
protected override void ShowUI() { }
|
|
136
|
-
|
|
137
|
-
/// <inheritdoc/>
|
|
138
|
-
protected override void HideUI() { }
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/// <inheritdoc/>
|
|
142
|
-
protected override IEnumerator WaitForUIToComplete()
|
|
143
|
-
{
|
|
144
|
-
TransitionTrialCamera();
|
|
145
|
-
|
|
146
|
-
Fade(transitionFadeToValue, transitionFadeToDuration);
|
|
147
|
-
|
|
148
|
-
yield return WaitForTransitionToFinish();
|
|
149
|
-
|
|
150
|
-
DisplayOpeningAnimator(true);
|
|
151
|
-
|
|
152
|
-
ResetTrialCameraOverrides();
|
|
153
|
-
|
|
154
|
-
EnableVolume();
|
|
155
|
-
|
|
156
|
-
Fade(transitionFadeOutValue, transitionFadeOutDuration);
|
|
157
|
-
|
|
158
|
-
DisplayIntro();
|
|
159
|
-
|
|
160
|
-
yield return new WaitForSeconds(transitionFadeOutDuration);
|
|
161
|
-
|
|
162
|
-
DisableOverlay();
|
|
163
|
-
|
|
164
|
-
PlayIntroSound();
|
|
165
|
-
|
|
166
|
-
yield return new WaitForSeconds(openingAnimationAdditionalWaitTime);
|
|
167
|
-
|
|
168
|
-
DisplayOpeningAnimator(false);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/// <summary>
|
|
172
|
-
///
|
|
173
|
-
/// </summary>
|
|
174
|
-
protected virtual void TransitionTrialCamera()
|
|
175
|
-
{
|
|
176
|
-
if (trialCameraDR == null)
|
|
177
|
-
trialCameraDR = FindAnyObjectByType<DRTrialCamera>();
|
|
178
|
-
|
|
179
|
-
trialCameraDR.TriggerAnim(transitionCameraAnimationName);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/// <summary>
|
|
183
|
-
///
|
|
184
|
-
/// </summary>
|
|
185
|
-
/// <param name="show"></param>
|
|
186
|
-
protected virtual void DisplayOpeningAnimator(bool show)
|
|
187
|
-
{
|
|
188
|
-
if (openingAnimator == null)
|
|
189
|
-
return;
|
|
190
|
-
|
|
191
|
-
if (show)
|
|
192
|
-
openingAnimator.Show();
|
|
193
|
-
else
|
|
194
|
-
openingAnimator.Hide();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/// <summary>
|
|
198
|
-
///
|
|
199
|
-
/// </summary>
|
|
200
|
-
/// <param name="to"></param>
|
|
201
|
-
/// <param name="duration"></param>
|
|
202
|
-
protected virtual void Fade(float to, float duration)
|
|
203
|
-
{
|
|
204
|
-
if (transitionBlackFade != null)
|
|
205
|
-
#if DOTWEEN
|
|
206
|
-
transitionBlackFade.DOFade(to, duration);
|
|
207
|
-
#else
|
|
208
|
-
transitionBlackFade.color = new(transitionBlackFade.color.r, transitionBlackFade.color.g, transitionBlackFade.color.b, to);
|
|
209
|
-
#endif
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/// <summary>
|
|
213
|
-
///
|
|
214
|
-
/// </summary>
|
|
215
|
-
protected virtual IEnumerator WaitForTransitionToFinish()
|
|
216
|
-
{
|
|
217
|
-
float animationLength = trialCameraDR.CameraAnimator.GetAnimationClip(transitionCameraAnimationName).length;
|
|
218
|
-
|
|
219
|
-
if (divideOpeningCameraAnimationLength > 0)
|
|
220
|
-
yield return new WaitForSeconds(animationLength / divideOpeningCameraAnimationLength);
|
|
221
|
-
else
|
|
222
|
-
yield return new WaitForSeconds(animationLength);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/// <summary>
|
|
226
|
-
///
|
|
227
|
-
/// </summary>
|
|
228
|
-
protected virtual void ResetTrialCameraOverrides() => trialCameraDR.SetDefaultValues();
|
|
229
|
-
|
|
230
|
-
/// <summary>
|
|
231
|
-
///
|
|
232
|
-
/// </summary>
|
|
233
|
-
protected virtual void EnableVolume()
|
|
234
|
-
{
|
|
235
|
-
if (volume != null)
|
|
236
|
-
volume.enabled = true;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/// <summary>
|
|
240
|
-
///
|
|
241
|
-
/// </summary>
|
|
242
|
-
protected virtual void DisplayIntro() => trialCameraDR.TriggerAnim(openingCameraAnimationName);
|
|
243
|
-
|
|
244
|
-
/// <summary>
|
|
245
|
-
///
|
|
246
|
-
/// </summary>
|
|
247
|
-
protected virtual void DisableOverlay()
|
|
248
|
-
{
|
|
249
|
-
if (transitionBlackFade != null)
|
|
250
|
-
transitionBlackFade.enabled = false;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/// <summary>
|
|
254
|
-
///
|
|
255
|
-
/// </summary>
|
|
256
|
-
protected virtual void PlayIntroSound() => onPlayIntroSound?.Invoke();
|
|
257
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if DOTWEEN
|
|
3
|
+
using DG.Tweening;
|
|
4
|
+
#endif
|
|
5
|
+
using DREditor.Cameras;
|
|
6
|
+
using DREditor.Dialogues;
|
|
7
|
+
using DREditor.UIHandling;
|
|
8
|
+
using System.Collections;
|
|
9
|
+
using System.Linq;
|
|
10
|
+
using UnityEngine;
|
|
11
|
+
using UnityEngine.Events;
|
|
12
|
+
using UnityEngine.Rendering;
|
|
13
|
+
using UnityEngine.UI;
|
|
14
|
+
|
|
15
|
+
namespace DREditor.Minigames.NSD.Managers
|
|
16
|
+
{
|
|
17
|
+
//I commented the process so that it'd be easier for others to understand the sequence of events,
|
|
18
|
+
//not that the code doesn't explain it well enough already.
|
|
19
|
+
/// <summary>
|
|
20
|
+
///
|
|
21
|
+
/// </summary>
|
|
22
|
+
[ClassHeader(nameof(UIVisibilityComponent) + ", " + nameof(IUIVisibility) +
|
|
23
|
+
"\n\n")]
|
|
24
|
+
public class NSDIntro : UIVisibilityComponent
|
|
25
|
+
{
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Header("")]
|
|
30
|
+
[Divider]
|
|
31
|
+
[Tooltip("")]
|
|
32
|
+
[SerializeField] protected string transitionCameraAnimationName = "NSD-transition";
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
///
|
|
36
|
+
/// </summary>
|
|
37
|
+
[Tooltip("")]
|
|
38
|
+
[SerializeField] protected Image transitionBlackFade = null;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
///
|
|
43
|
+
/// </summary>
|
|
44
|
+
[Header("")]
|
|
45
|
+
[Divider]
|
|
46
|
+
[Tooltip("")]
|
|
47
|
+
[SerializeField] protected float divideOpeningCameraAnimationLength = 1.5f;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Header("")]
|
|
54
|
+
[Divider]
|
|
55
|
+
[Range(0, 1)]
|
|
56
|
+
[Tooltip("")]
|
|
57
|
+
[SerializeField] protected float transitionFadeToValue = 1;
|
|
58
|
+
|
|
59
|
+
/// <summary>
|
|
60
|
+
///
|
|
61
|
+
/// </summary>
|
|
62
|
+
[Tooltip("")]
|
|
63
|
+
[SerializeField] protected float transitionFadeToDuration = 1;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
///
|
|
68
|
+
/// </summary>
|
|
69
|
+
[Header("")]
|
|
70
|
+
[Divider]
|
|
71
|
+
[Range(0, 1)]
|
|
72
|
+
[Tooltip("")]
|
|
73
|
+
[SerializeField] protected float transitionFadeOutValue = 0;
|
|
74
|
+
|
|
75
|
+
/// <summary>
|
|
76
|
+
///
|
|
77
|
+
/// </summary>
|
|
78
|
+
[Tooltip("")]
|
|
79
|
+
[SerializeField] protected float transitionFadeOutDuration = 0.5f;
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
/// <summary>
|
|
83
|
+
///
|
|
84
|
+
/// </summary>
|
|
85
|
+
[Header("")]
|
|
86
|
+
[Divider]
|
|
87
|
+
[Tooltip("")]
|
|
88
|
+
[SerializeField] protected string openingCameraAnimationName = "NSD-intro";
|
|
89
|
+
|
|
90
|
+
/// <summary>
|
|
91
|
+
///
|
|
92
|
+
/// </summary>
|
|
93
|
+
[Tooltip("")]
|
|
94
|
+
[SerializeField] protected UIVisibilityComponent openingAnimator = null;
|
|
95
|
+
|
|
96
|
+
/// <summary>
|
|
97
|
+
///
|
|
98
|
+
/// </summary>
|
|
99
|
+
[Tooltip("")]
|
|
100
|
+
[SerializeField] protected float openingAnimationAdditionalWaitTime = 4;
|
|
101
|
+
|
|
102
|
+
/// <summary>
|
|
103
|
+
///
|
|
104
|
+
/// </summary>
|
|
105
|
+
[Tooltip("")]
|
|
106
|
+
[SerializeField] protected VolumeProfile volumeProfile = null;
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
[Header("")]
|
|
110
|
+
[SerializeField] protected UnityEvent onPlayIntroSound = null;
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
/// <summary>
|
|
114
|
+
///
|
|
115
|
+
/// </summary>
|
|
116
|
+
protected DRTrialCamera trialCameraDR = null;
|
|
117
|
+
|
|
118
|
+
/// <summary>
|
|
119
|
+
///
|
|
120
|
+
/// </summary>
|
|
121
|
+
protected Volume volume = null;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
protected virtual void Start()
|
|
125
|
+
{
|
|
126
|
+
trialCameraDR = FindAnyObjectByType<DRTrialCamera>();
|
|
127
|
+
|
|
128
|
+
if (volumeProfile != null)
|
|
129
|
+
volume = FindObjectsByType<Volume>()
|
|
130
|
+
.Where(foundVolume => foundVolume.profile.name == volumeProfile.name)
|
|
131
|
+
.FirstOrDefault();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/// <inheritdoc/>
|
|
135
|
+
protected override void ShowUI() { }
|
|
136
|
+
|
|
137
|
+
/// <inheritdoc/>
|
|
138
|
+
protected override void HideUI() { }
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
/// <inheritdoc/>
|
|
142
|
+
protected override IEnumerator WaitForUIToComplete()
|
|
143
|
+
{
|
|
144
|
+
TransitionTrialCamera();
|
|
145
|
+
|
|
146
|
+
Fade(transitionFadeToValue, transitionFadeToDuration);
|
|
147
|
+
|
|
148
|
+
yield return WaitForTransitionToFinish();
|
|
149
|
+
|
|
150
|
+
DisplayOpeningAnimator(true);
|
|
151
|
+
|
|
152
|
+
ResetTrialCameraOverrides();
|
|
153
|
+
|
|
154
|
+
EnableVolume();
|
|
155
|
+
|
|
156
|
+
Fade(transitionFadeOutValue, transitionFadeOutDuration);
|
|
157
|
+
|
|
158
|
+
DisplayIntro();
|
|
159
|
+
|
|
160
|
+
yield return new WaitForSeconds(transitionFadeOutDuration);
|
|
161
|
+
|
|
162
|
+
DisableOverlay();
|
|
163
|
+
|
|
164
|
+
PlayIntroSound();
|
|
165
|
+
|
|
166
|
+
yield return new WaitForSeconds(openingAnimationAdditionalWaitTime);
|
|
167
|
+
|
|
168
|
+
DisplayOpeningAnimator(false);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/// <summary>
|
|
172
|
+
///
|
|
173
|
+
/// </summary>
|
|
174
|
+
protected virtual void TransitionTrialCamera()
|
|
175
|
+
{
|
|
176
|
+
if (trialCameraDR == null)
|
|
177
|
+
trialCameraDR = FindAnyObjectByType<DRTrialCamera>();
|
|
178
|
+
|
|
179
|
+
trialCameraDR.TriggerAnim(transitionCameraAnimationName);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/// <summary>
|
|
183
|
+
///
|
|
184
|
+
/// </summary>
|
|
185
|
+
/// <param name="show"></param>
|
|
186
|
+
protected virtual void DisplayOpeningAnimator(bool show)
|
|
187
|
+
{
|
|
188
|
+
if (openingAnimator == null)
|
|
189
|
+
return;
|
|
190
|
+
|
|
191
|
+
if (show)
|
|
192
|
+
openingAnimator.Show();
|
|
193
|
+
else
|
|
194
|
+
openingAnimator.Hide();
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/// <summary>
|
|
198
|
+
///
|
|
199
|
+
/// </summary>
|
|
200
|
+
/// <param name="to"></param>
|
|
201
|
+
/// <param name="duration"></param>
|
|
202
|
+
protected virtual void Fade(float to, float duration)
|
|
203
|
+
{
|
|
204
|
+
if (transitionBlackFade != null)
|
|
205
|
+
#if DOTWEEN
|
|
206
|
+
transitionBlackFade.DOFade(to, duration);
|
|
207
|
+
#else
|
|
208
|
+
transitionBlackFade.color = new(transitionBlackFade.color.r, transitionBlackFade.color.g, transitionBlackFade.color.b, to);
|
|
209
|
+
#endif
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/// <summary>
|
|
213
|
+
///
|
|
214
|
+
/// </summary>
|
|
215
|
+
protected virtual IEnumerator WaitForTransitionToFinish()
|
|
216
|
+
{
|
|
217
|
+
float animationLength = trialCameraDR.CameraAnimator.GetAnimationClip(transitionCameraAnimationName).length;
|
|
218
|
+
|
|
219
|
+
if (divideOpeningCameraAnimationLength > 0)
|
|
220
|
+
yield return new WaitForSeconds(animationLength / divideOpeningCameraAnimationLength);
|
|
221
|
+
else
|
|
222
|
+
yield return new WaitForSeconds(animationLength);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/// <summary>
|
|
226
|
+
///
|
|
227
|
+
/// </summary>
|
|
228
|
+
protected virtual void ResetTrialCameraOverrides() => trialCameraDR.SetDefaultValues();
|
|
229
|
+
|
|
230
|
+
/// <summary>
|
|
231
|
+
///
|
|
232
|
+
/// </summary>
|
|
233
|
+
protected virtual void EnableVolume()
|
|
234
|
+
{
|
|
235
|
+
if (volume != null)
|
|
236
|
+
volume.enabled = true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/// <summary>
|
|
240
|
+
///
|
|
241
|
+
/// </summary>
|
|
242
|
+
protected virtual void DisplayIntro() => trialCameraDR.TriggerAnim(openingCameraAnimationName);
|
|
243
|
+
|
|
244
|
+
/// <summary>
|
|
245
|
+
///
|
|
246
|
+
/// </summary>
|
|
247
|
+
protected virtual void DisableOverlay()
|
|
248
|
+
{
|
|
249
|
+
if (transitionBlackFade != null)
|
|
250
|
+
transitionBlackFade.enabled = false;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/// <summary>
|
|
254
|
+
///
|
|
255
|
+
/// </summary>
|
|
256
|
+
protected virtual void PlayIntroSound() => onPlayIntroSound?.Invoke();
|
|
257
|
+
}
|
|
258
258
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: b3f27b9c2f03c464481d61a97b1aa03a
|
|
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: b3f27b9c2f03c464481d61a97b1aa03a
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|