Skip to content

Commit 14bae79

Browse files
committed
Improved manager, QOL, fixes
+Made it so it is now simple to change slider animation for custom duration. It is automatically updated based on values from RewindManager +Added editor field for more convenient setup of how many seconds to track +Made RewindManager as singleton for more convenient access (taking the latest instance) +RewindManager now acts more like manager when controlling RewindAbstract classes directly without events. The code should be now more readable and is cleaner. +Due to RewindManager taking a lot more responsibility now, it should be harder to accidently override RewindAbstract methods and more methods can be used in custom solutions +Added more options in rewind manager (to pause/resume tracking, restarting tracking) +Added more option to RewindBySlider (Slider prefab also contains new buttons where player can pause tracking, pause rewind, reset tracking etc...) +Fixed unecessary garbage generation in velocity tracking system +Renamed fields regarding particle rewinds for better clarity
1 parent 8ae04f0 commit 14bae79

13 files changed

Lines changed: 1772 additions & 537 deletions

File tree

Assets/TimeRewinder/ExampleScene/TimeRewindExample 1.unity

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,15 @@ MonoBehaviour:
270270
trackAnimator: 0
271271
trackAudio: 1
272272
trackParticles:
273-
enabled: 0
273+
enabled: 1
274274
value:
275-
particleLimiter: 0
276-
particleResetTo: 0
277-
particlesData: []
275+
particleTrackingLimit: 10
276+
particleRestartFrom: 5
277+
particlesData:
278+
- particleSystem: {fileID: 403565797}
279+
particleSystemMainObject: {fileID: 399947957}
280+
- particleSystem: {fileID: 1116574891}
281+
particleSystemMainObject: {fileID: 399947957}
278282
--- !u!23 &13430125
279283
MeshRenderer:
280284
m_ObjectHideFlags: 0
@@ -668,8 +672,8 @@ MonoBehaviour:
668672
trackParticles:
669673
enabled: 0
670674
value:
671-
particleLimiter: 0
672-
particleResetTo: 0
675+
particleTrackingLimit: 0
676+
particleRestartFrom: 0
673677
particlesData: []
674678
--- !u!82 &184878771
675679
AudioSource:
@@ -975,10 +979,22 @@ PrefabInstance:
975979
m_Modification:
976980
m_TransformParent: {fileID: 0}
977981
m_Modifications:
982+
- target: {fileID: 4065960114628133192, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
983+
propertyPath: m_AnchoredPosition.x
984+
value: -4.9999695
985+
objectReference: {fileID: 0}
986+
- target: {fileID: 4065960115090877166, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
987+
propertyPath: m_AnchorMax.x
988+
value: 0
989+
objectReference: {fileID: 0}
978990
- target: {fileID: 4065960115090877166, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
979991
propertyPath: m_AnchorMax.y
980992
value: 0
981993
objectReference: {fileID: 0}
994+
- target: {fileID: 4065960115090877166, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
995+
propertyPath: m_AnchorMin.x
996+
value: 0
997+
objectReference: {fileID: 0}
982998
- target: {fileID: 4065960115365519547, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
983999
propertyPath: m_RootOrder
9841000
value: 8
@@ -1027,6 +1043,14 @@ PrefabInstance:
10271043
propertyPath: m_Name
10281044
value: ClockSlider
10291045
objectReference: {fileID: 0}
1046+
- target: {fileID: 4065960115365519549, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
1047+
propertyPath: m_IsActive
1048+
value: 1
1049+
objectReference: {fileID: 0}
1050+
- target: {fileID: 4065960116200895156, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
1051+
propertyPath: m_AnchorMax.x
1052+
value: 0
1053+
objectReference: {fileID: 0}
10301054
- target: {fileID: 4065960116200895156, guid: 0fb06aceffb6a294c8971e56e984b534, type: 3}
10311055
propertyPath: m_AnchorMax.y
10321056
value: 0
@@ -1099,6 +1123,16 @@ Transform:
10991123
m_Father: {fileID: 0}
11001124
m_RootOrder: 7
11011125
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1126+
--- !u!1 &399947957 stripped
1127+
GameObject:
1128+
m_CorrespondingSourceObject: {fileID: 1000012118400646, guid: 3123da49cb81147489b444f2749aba47, type: 3}
1129+
m_PrefabInstance: {fileID: 165187786}
1130+
m_PrefabAsset: {fileID: 0}
1131+
--- !u!198 &403565797 stripped
1132+
ParticleSystem:
1133+
m_CorrespondingSourceObject: {fileID: 198000014016860652, guid: 3123da49cb81147489b444f2749aba47, type: 3}
1134+
m_PrefabInstance: {fileID: 165187786}
1135+
m_PrefabAsset: {fileID: 0}
11021136
--- !u!1 &474125695
11031137
GameObject:
11041138
m_ObjectHideFlags: 0
@@ -1831,11 +1865,11 @@ MonoBehaviour:
18311865
m_EditorClassIdentifier:
18321866
particleTimer: {fileID: 873755460}
18331867
particleSettings:
1834-
particleLimiter: 10
1835-
particleResetTo: 1
1868+
particleTrackingLimit: 10
1869+
particleRestartFrom: 5
18361870
particlesData:
18371871
- particleSystem: {fileID: 198350596}
1838-
particleSystemEnabler: {fileID: 198350593}
1872+
particleSystemMainObject: {fileID: 198350593}
18391873
--- !u!82 &873755459
18401874
AudioSource:
18411875
m_ObjectHideFlags: 0
@@ -2141,11 +2175,11 @@ MonoBehaviour:
21412175
trackParticles:
21422176
enabled: 0
21432177
value:
2144-
particleLimiter: 0
2145-
particleResetTo: 0
2178+
particleTrackingLimit: 0
2179+
particleRestartFrom: 0
21462180
particlesData:
21472181
- particleSystem: {fileID: 0}
2148-
particleSystemEnabler: {fileID: 0}
2182+
particleSystemMainObject: {fileID: 0}
21492183
--- !u!1 &941752917
21502184
GameObject:
21512185
m_ObjectHideFlags: 0
@@ -2558,6 +2592,11 @@ CanvasRenderer:
25582592
m_PrefabAsset: {fileID: 0}
25592593
m_GameObject: {fileID: 1047236821}
25602594
m_CullTransparentMesh: 1
2595+
--- !u!198 &1116574891 stripped
2596+
ParticleSystem:
2597+
m_CorrespondingSourceObject: {fileID: 198000014052238036, guid: 3123da49cb81147489b444f2749aba47, type: 3}
2598+
m_PrefabInstance: {fileID: 165187786}
2599+
m_PrefabAsset: {fileID: 0}
25612600
--- !u!1 &1187936697
25622601
GameObject:
25632602
m_ObjectHideFlags: 0

Assets/TimeRewinder/TimeRewinderImplementation/Animations/AutoResizeAnim.anim

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ AnimationClip:
2323
- serializedVersion: 3
2424
time: 0
2525
value: 20
26-
inSlope: 50
27-
outSlope: 50
26+
inSlope: 600
27+
outSlope: 600
2828
tangentMode: 34
2929
weightedMode: 0
3030
inWeight: 0.33333334
3131
outWeight: 0.33333334
3232
- serializedVersion: 3
33-
time: 12
33+
time: 1
3434
value: 620
35-
inSlope: 50
36-
outSlope: 50
35+
inSlope: 600
36+
outSlope: 600
3737
tangentMode: 34
3838
weightedMode: 0
3939
inWeight: 0.33333334
@@ -51,17 +51,17 @@ AnimationClip:
5151
- serializedVersion: 3
5252
time: 0
5353
value: -600
54-
inSlope: 50
55-
outSlope: 50
54+
inSlope: 600
55+
outSlope: 600
5656
tangentMode: 34
5757
weightedMode: 0
5858
inWeight: 0.33333334
5959
outWeight: 0.33333334
6060
- serializedVersion: 3
61-
time: 12
61+
time: 1
6262
value: 0
63-
inSlope: 50
64-
outSlope: 50
63+
inSlope: 600
64+
outSlope: 600
6565
tangentMode: 34
6666
weightedMode: 0
6767
inWeight: 0.33333334
@@ -79,17 +79,17 @@ AnimationClip:
7979
- serializedVersion: 3
8080
time: 0
8181
value: 0
82-
inSlope: -0.99916667
83-
outSlope: -0.99916667
82+
inSlope: -1
83+
outSlope: -1
8484
tangentMode: 34
8585
weightedMode: 0
8686
inWeight: 0.33333334
8787
outWeight: 0.33333334
8888
- serializedVersion: 3
89-
time: 12
90-
value: -11.99
91-
inSlope: -0.99916667
92-
outSlope: -0.99916667
89+
time: 1
90+
value: -1
91+
inSlope: -1
92+
outSlope: -1
9393
tangentMode: 34
9494
weightedMode: 0
9595
inWeight: 0.33333334
@@ -107,17 +107,17 @@ AnimationClip:
107107
- serializedVersion: 3
108108
time: 0
109109
value: 305
110-
inSlope: -25
111-
outSlope: -25
110+
inSlope: -300
111+
outSlope: -300
112112
tangentMode: 34
113113
weightedMode: 0
114114
inWeight: 0.33333334
115115
outWeight: 0.33333334
116116
- serializedVersion: 3
117-
time: 12
117+
time: 1
118118
value: 5
119-
inSlope: -25
120-
outSlope: -25
119+
inSlope: -300
120+
outSlope: -300
121121
tangentMode: 34
122122
weightedMode: 0
123123
inWeight: 0.33333334
@@ -135,17 +135,17 @@ AnimationClip:
135135
- serializedVersion: 3
136136
time: 0
137137
value: 590
138-
inSlope: -50
139-
outSlope: -50
138+
inSlope: -600
139+
outSlope: -600
140140
tangentMode: 34
141141
weightedMode: 0
142142
inWeight: 0.33333334
143143
outWeight: 0.33333334
144144
- serializedVersion: 3
145-
time: 12
145+
time: 1
146146
value: -10
147-
inSlope: -50
148-
outSlope: -50
147+
inSlope: -600
148+
outSlope: -600
149149
tangentMode: 34
150150
weightedMode: 0
151151
inWeight: 0.33333334
@@ -206,7 +206,7 @@ AnimationClip:
206206
m_AdditiveReferencePoseClip: {fileID: 0}
207207
m_AdditiveReferencePoseTime: 0
208208
m_StartTime: 0
209-
m_StopTime: 12
209+
m_StopTime: 1
210210
m_OrientationOffsetY: 0
211211
m_Level: 0
212212
m_CycleOffset: 0
@@ -228,17 +228,17 @@ AnimationClip:
228228
- serializedVersion: 3
229229
time: 0
230230
value: 20
231-
inSlope: 50
232-
outSlope: 50
231+
inSlope: 600
232+
outSlope: 600
233233
tangentMode: 34
234234
weightedMode: 0
235235
inWeight: 0.33333334
236236
outWeight: 0.33333334
237237
- serializedVersion: 3
238-
time: 12
238+
time: 1
239239
value: 620
240-
inSlope: 50
241-
outSlope: 50
240+
inSlope: 600
241+
outSlope: 600
242242
tangentMode: 34
243243
weightedMode: 0
244244
inWeight: 0.33333334
@@ -256,17 +256,17 @@ AnimationClip:
256256
- serializedVersion: 3
257257
time: 0
258258
value: -600
259-
inSlope: 50
260-
outSlope: 50
259+
inSlope: 600
260+
outSlope: 600
261261
tangentMode: 34
262262
weightedMode: 0
263263
inWeight: 0.33333334
264264
outWeight: 0.33333334
265265
- serializedVersion: 3
266-
time: 12
266+
time: 1
267267
value: 0
268-
inSlope: 50
269-
outSlope: 50
268+
inSlope: 600
269+
outSlope: 600
270270
tangentMode: 34
271271
weightedMode: 0
272272
inWeight: 0.33333334
@@ -284,17 +284,17 @@ AnimationClip:
284284
- serializedVersion: 3
285285
time: 0
286286
value: 0
287-
inSlope: -0.99916667
288-
outSlope: -0.99916667
287+
inSlope: -1
288+
outSlope: -1
289289
tangentMode: 34
290290
weightedMode: 0
291291
inWeight: 0.33333334
292292
outWeight: 0.33333334
293293
- serializedVersion: 3
294-
time: 12
295-
value: -11.99
296-
inSlope: -0.99916667
297-
outSlope: -0.99916667
294+
time: 1
295+
value: -1
296+
inSlope: -1
297+
outSlope: -1
298298
tangentMode: 34
299299
weightedMode: 0
300300
inWeight: 0.33333334
@@ -312,17 +312,17 @@ AnimationClip:
312312
- serializedVersion: 3
313313
time: 0
314314
value: 305
315-
inSlope: -25
316-
outSlope: -25
315+
inSlope: -300
316+
outSlope: -300
317317
tangentMode: 34
318318
weightedMode: 0
319319
inWeight: 0.33333334
320320
outWeight: 0.33333334
321321
- serializedVersion: 3
322-
time: 12
322+
time: 1
323323
value: 5
324-
inSlope: -25
325-
outSlope: -25
324+
inSlope: -300
325+
outSlope: -300
326326
tangentMode: 34
327327
weightedMode: 0
328328
inWeight: 0.33333334
@@ -340,17 +340,17 @@ AnimationClip:
340340
- serializedVersion: 3
341341
time: 0
342342
value: 590
343-
inSlope: -50
344-
outSlope: -50
343+
inSlope: -600
344+
outSlope: -600
345345
tangentMode: 34
346346
weightedMode: 0
347347
inWeight: 0.33333334
348348
outWeight: 0.33333334
349349
- serializedVersion: 3
350-
time: 12
350+
time: 1
351351
value: -10
352-
inSlope: -50
353-
outSlope: -50
352+
inSlope: -600
353+
outSlope: -600
354354
tangentMode: 34
355355
weightedMode: 0
356356
inWeight: 0.33333334

Assets/TimeRewinder/TimeRewinderImplementation/Animations/SliderAnimator.controller

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AnimatorState:
1616
m_IKOnFeet: 0
1717
m_WriteDefaultValues: 1
1818
m_Mirror: 0
19-
m_SpeedParameterActive: 1
19+
m_SpeedParameterActive: 0
2020
m_MirrorParameterActive: 0
2121
m_CycleOffsetParameterActive: 0
2222
m_TimeParameterActive: 0
@@ -34,13 +34,7 @@ AnimatorController:
3434
m_PrefabAsset: {fileID: 0}
3535
m_Name: SliderAnimator
3636
serializedVersion: 5
37-
m_AnimatorParameters:
38-
- m_Name: TimeRewindSpeed
39-
m_Type: 1
40-
m_DefaultFloat: 1
41-
m_DefaultInt: 0
42-
m_DefaultBool: 0
43-
m_Controller: {fileID: 0}
37+
m_AnimatorParameters: []
4438
m_AnimatorLayers:
4539
- serializedVersion: 5
4640
m_Name: Base Layer

0 commit comments

Comments
 (0)