Skip to content

Commit 51aa797

Browse files
committed
Feature update
+Added support to dynamically add new tracked objects in the middle of the game (added third demo scene showcasing that) +Added support for animator transitions +Now also tracking animator parameters +Now also tracking audio pitch and volume in audio rewinds +Performance optimizations of animators and audio rewinds
1 parent c5ef1ce commit 51aa797

File tree

17 files changed

+1636
-42
lines changed

17 files changed

+1636
-42
lines changed
214 KB
Binary file not shown.
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1 &6575052772619110468
4+
GameObject:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
serializedVersion: 6
10+
m_Component:
11+
- component: {fileID: 6638264440216342496}
12+
- component: {fileID: 9047953480557728990}
13+
- component: {fileID: 146551698335610000}
14+
- component: {fileID: 4261297542584240599}
15+
- component: {fileID: 8508541106391306425}
16+
- component: {fileID: 2417462987792383690}
17+
m_Layer: 0
18+
m_Name: Projectile
19+
m_TagString: Untagged
20+
m_Icon: {fileID: 0}
21+
m_NavMeshLayer: 0
22+
m_StaticEditorFlags: 0
23+
m_IsActive: 1
24+
--- !u!4 &6638264440216342496
25+
Transform:
26+
m_ObjectHideFlags: 0
27+
m_CorrespondingSourceObject: {fileID: 0}
28+
m_PrefabInstance: {fileID: 0}
29+
m_PrefabAsset: {fileID: 0}
30+
m_GameObject: {fileID: 6575052772619110468}
31+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
32+
m_LocalPosition: {x: -16.94, y: -18.181, z: 16.14}
33+
m_LocalScale: {x: 1, y: 1, z: 1}
34+
m_Children: []
35+
m_Father: {fileID: 0}
36+
m_RootOrder: 0
37+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
38+
--- !u!33 &9047953480557728990
39+
MeshFilter:
40+
m_ObjectHideFlags: 0
41+
m_CorrespondingSourceObject: {fileID: 0}
42+
m_PrefabInstance: {fileID: 0}
43+
m_PrefabAsset: {fileID: 0}
44+
m_GameObject: {fileID: 6575052772619110468}
45+
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
46+
--- !u!23 &146551698335610000
47+
MeshRenderer:
48+
m_ObjectHideFlags: 0
49+
m_CorrespondingSourceObject: {fileID: 0}
50+
m_PrefabInstance: {fileID: 0}
51+
m_PrefabAsset: {fileID: 0}
52+
m_GameObject: {fileID: 6575052772619110468}
53+
m_Enabled: 1
54+
m_CastShadows: 1
55+
m_ReceiveShadows: 1
56+
m_DynamicOccludee: 1
57+
m_MotionVectors: 1
58+
m_LightProbeUsage: 1
59+
m_ReflectionProbeUsage: 1
60+
m_RayTracingMode: 2
61+
m_RayTraceProcedural: 0
62+
m_RenderingLayerMask: 1
63+
m_RendererPriority: 0
64+
m_Materials:
65+
- {fileID: 8554655104631171556, guid: 97b1b363fb42efc42899dbe6efc813c2, type: 3}
66+
m_StaticBatchInfo:
67+
firstSubMesh: 0
68+
subMeshCount: 0
69+
m_StaticBatchRoot: {fileID: 0}
70+
m_ProbeAnchor: {fileID: 0}
71+
m_LightProbeVolumeOverride: {fileID: 0}
72+
m_ScaleInLightmap: 1
73+
m_ReceiveGI: 1
74+
m_PreserveUVs: 0
75+
m_IgnoreNormalsForChartDetection: 0
76+
m_ImportantGI: 0
77+
m_StitchLightmapSeams: 1
78+
m_SelectedEditorRenderState: 3
79+
m_MinimumChartSize: 4
80+
m_AutoUVMaxDistance: 0.5
81+
m_AutoUVMaxAngle: 89
82+
m_LightmapParameters: {fileID: 0}
83+
m_SortingLayerID: 0
84+
m_SortingLayer: 0
85+
m_SortingOrder: 0
86+
m_AdditionalVertexStreams: {fileID: 0}
87+
--- !u!135 &4261297542584240599
88+
SphereCollider:
89+
m_ObjectHideFlags: 0
90+
m_CorrespondingSourceObject: {fileID: 0}
91+
m_PrefabInstance: {fileID: 0}
92+
m_PrefabAsset: {fileID: 0}
93+
m_GameObject: {fileID: 6575052772619110468}
94+
m_Material: {fileID: 0}
95+
m_IsTrigger: 0
96+
m_Enabled: 1
97+
serializedVersion: 2
98+
m_Radius: 0.5
99+
m_Center: {x: 0, y: 0, z: 0}
100+
--- !u!54 &8508541106391306425
101+
Rigidbody:
102+
m_ObjectHideFlags: 0
103+
m_CorrespondingSourceObject: {fileID: 0}
104+
m_PrefabInstance: {fileID: 0}
105+
m_PrefabAsset: {fileID: 0}
106+
m_GameObject: {fileID: 6575052772619110468}
107+
serializedVersion: 2
108+
m_Mass: 1
109+
m_Drag: 0
110+
m_AngularDrag: 0.05
111+
m_UseGravity: 1
112+
m_IsKinematic: 0
113+
m_Interpolate: 0
114+
m_Constraints: 0
115+
m_CollisionDetection: 0
116+
--- !u!114 &2417462987792383690
117+
MonoBehaviour:
118+
m_ObjectHideFlags: 0
119+
m_CorrespondingSourceObject: {fileID: 0}
120+
m_PrefabInstance: {fileID: 0}
121+
m_PrefabAsset: {fileID: 0}
122+
m_GameObject: {fileID: 6575052772619110468}
123+
m_Enabled: 1
124+
m_EditorHideFlags: 0
125+
m_Script: {fileID: 11500000, guid: b1853014c10a6eb46a8363fdc11758e7, type: 3}
126+
m_Name:
127+
m_EditorClassIdentifier:
128+
trackObjectActiveState: 0
129+
trackTransform: 1
130+
trackVelocity: 1
131+
trackAnimator: 0
132+
trackAudio: 0
133+
trackParticles:
134+
enabled: 0
135+
value:
136+
particleTrackingLimit: 0
137+
particleRestartFrom: 0
138+
particleSystems: []

Assets/TimeRewinder/ExampleScene/Import/Projectile.prefab.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/TimeRewinder/ExampleScene/Import/source/DinosaurAnim.controller

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ AnimatorStateTransition:
1717
m_Mute: 0
1818
m_IsExit: 0
1919
serializedVersion: 3
20-
m_TransitionDuration: 0
20+
m_TransitionDuration: 0.1
2121
m_TransitionOffset: 0
2222
m_ExitTime: 0.75
2323
m_HasExitTime: 0
24-
m_HasFixedDuration: 1
24+
m_HasFixedDuration: 0
2525
m_InterruptionSource: 0
2626
m_OrderedInterruption: 1
2727
m_CanTransitionToSelf: 1
@@ -39,11 +39,11 @@ AnimatorStateTransition:
3939
m_Mute: 0
4040
m_IsExit: 0
4141
serializedVersion: 3
42-
m_TransitionDuration: 0
42+
m_TransitionDuration: 0.1
4343
m_TransitionOffset: 0
4444
m_ExitTime: 1
4545
m_HasExitTime: 1
46-
m_HasFixedDuration: 1
46+
m_HasFixedDuration: 0
4747
m_InterruptionSource: 0
4848
m_OrderedInterruption: 1
4949
m_CanTransitionToSelf: 1
@@ -61,11 +61,11 @@ AnimatorStateTransition:
6161
m_Mute: 0
6262
m_IsExit: 0
6363
serializedVersion: 3
64-
m_TransitionDuration: 0
64+
m_TransitionDuration: 0.1
6565
m_TransitionOffset: 0
6666
m_ExitTime: 1
6767
m_HasExitTime: 1
68-
m_HasFixedDuration: 1
68+
m_HasFixedDuration: 0
6969
m_InterruptionSource: 0
7070
m_OrderedInterruption: 1
7171
m_CanTransitionToSelf: 1
@@ -124,11 +124,11 @@ AnimatorStateTransition:
124124
m_Mute: 0
125125
m_IsExit: 0
126126
serializedVersion: 3
127-
m_TransitionDuration: 0
127+
m_TransitionDuration: 0.1
128128
m_TransitionOffset: 0
129129
m_ExitTime: 0.75
130130
m_HasExitTime: 0
131-
m_HasFixedDuration: 1
131+
m_HasFixedDuration: 0
132132
m_InterruptionSource: 0
133133
m_OrderedInterruption: 1
134134
m_CanTransitionToSelf: 1
@@ -301,11 +301,11 @@ AnimatorStateTransition:
301301
m_Mute: 0
302302
m_IsExit: 0
303303
serializedVersion: 3
304-
m_TransitionDuration: 0
304+
m_TransitionDuration: 0.1
305305
m_TransitionOffset: 0
306306
m_ExitTime: 0.75
307307
m_HasExitTime: 0
308-
m_HasFixedDuration: 1
308+
m_HasFixedDuration: 0
309309
m_InterruptionSource: 0
310310
m_OrderedInterruption: 1
311311
m_CanTransitionToSelf: 1
@@ -375,11 +375,11 @@ AnimatorStateTransition:
375375
m_Mute: 0
376376
m_IsExit: 0
377377
serializedVersion: 3
378-
m_TransitionDuration: 0
378+
m_TransitionDuration: 0.1
379379
m_TransitionOffset: 0
380380
m_ExitTime: 0.75
381381
m_HasExitTime: 0
382-
m_HasFixedDuration: 1
382+
m_HasFixedDuration: 0
383383
m_InterruptionSource: 0
384384
m_OrderedInterruption: 1
385385
m_CanTransitionToSelf: 1

Assets/TimeRewinder/ExampleScene/SceneMaterials.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!134 &13400000
4+
PhysicMaterial:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_Name: BouncySurface
10+
dynamicFriction: 0.6
11+
staticFriction: 0.6
12+
bounciness: 0.4
13+
frictionCombine: 0
14+
bounceCombine: 0

Assets/TimeRewinder/ExampleScene/SceneMaterials/BouncySurface.physicMaterial.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class GunBarell : MonoBehaviour
6+
{
7+
[SerializeField] GameObject _projectilePrefab;
8+
[SerializeField] Transform _spawnPoint;
9+
10+
public void Fire()
11+
{
12+
GameObject projectile = Instantiate(_projectilePrefab, _spawnPoint.position, Quaternion.identity);
13+
Rigidbody rb = projectile.GetComponent<Rigidbody>();
14+
RewindAbstract rewindAbstract = projectile.GetComponent<RewindAbstract>();
15+
16+
RewindManager.Instance.AddObjectForTracking(rewindAbstract, RewindManager.OutOfBoundsBehaviour.DisableDestroy); //Attaching it to the tracked in mid game
17+
18+
rb.AddForce((_spawnPoint.forward + new Vector3(Random.Range(0, 1), Random.Range(0, 1), Random.Range(0, 1)))*20, ForceMode.Impulse);
19+
}
20+
}

Assets/TimeRewinder/ExampleScene/ScriptsForScene/GunBarell.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)