From 9fc7e5572406d1dac48eac649461bfbc0ebfa0ed Mon Sep 17 00:00:00 2001 From: Jesus Imery Date: Tue, 14 Mar 2017 01:09:46 -0400 Subject: [PATCH] #1 #3 Modified time mechanics to use new dog FPS character --- .../Assets/Prefabs/Clone.prefab | 17 +++++++- .../Assets/Scripts/PlayerUserController.cs | 40 +++++++++++++++++-- Assets/Scripts/Dog/DogFP.cs | 5 +++ 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/Assets/PATimeRefactor/Assets/Prefabs/Clone.prefab b/Assets/PATimeRefactor/Assets/Prefabs/Clone.prefab index 2722854..bcef797 100644 --- a/Assets/PATimeRefactor/Assets/Prefabs/Clone.prefab +++ b/Assets/PATimeRefactor/Assets/Prefabs/Clone.prefab @@ -2382,7 +2382,7 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 100098} - m_LocalRotation: {x: 0.5326752, y: 0.070340455, z: 0.83613276, w: -0.110415146} + m_LocalRotation: {x: 0.53267515, y: 0.07034045, z: 0.83613265, w: -0.11041513} m_LocalPosition: {x: 0.000022271464, y: -0.00006150465, z: 0.026027026} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -2637,6 +2637,7 @@ GameObject: m_Component: - component: {fileID: 4429201076807062} - component: {fileID: 20990877827596502} + - component: {fileID: 114239455471679744} m_Layer: 19 m_Name: Camera m_TagString: Untagged @@ -2864,6 +2865,20 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f2f82afd0eba08845840bbb819f61e5a, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &114239455471679744 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1710866932611048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cd732fb44d34b94499d898ade1175074, type: 3} + m_Name: + m_EditorClassIdentifier: + shader: {fileID: 4800000, guid: ce9a06ac4ede6f84ab1865b7d32f204c, type: 3} + VHS: {fileID: 15200000, guid: 324a486eb541aa848884bad1ebd7b5e6, type: 3} + intensity: 1 --- !u!114 &114287554216745142 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/PATimeRefactor/Assets/Scripts/PlayerUserController.cs b/Assets/PATimeRefactor/Assets/Scripts/PlayerUserController.cs index 2b85789..604506e 100644 --- a/Assets/PATimeRefactor/Assets/Scripts/PlayerUserController.cs +++ b/Assets/PATimeRefactor/Assets/Scripts/PlayerUserController.cs @@ -2,10 +2,14 @@ using UnityEngine; using UnityStandardAssets.CrossPlatformInput; - public class PlayerUserController : MonoBehaviour { - private Character m_Character; // A reference to the ThirdPersonCharacter on the object +#if USING_DOG_CHARACTER + private DogFP m_Character; // A reference to the FirstPersonController on the object +#else + private Character m_Character; // A reference to the ThirdPersonCharacter on the object +#endif + public Transform m_Cam; // A reference to the main camera in the scenes transform private Vector3 m_CamForward; // The current forward direction of the camera @@ -20,7 +24,11 @@ public class PlayerUserController : MonoBehaviour private void Start() { +#if USING_DOG_CHARACTER + m_Character = GetComponent(); +#else m_Character = GetComponent(); +#endif m_HasPuppy = false; } @@ -59,9 +67,15 @@ private void FixedUpdate() case TimeManager.GameState.PARADOX: case TimeManager.GameState.REVERT: break; - + case TimeManager.GameState.NORMAL: + +#if USING_DOG_CHARACTER + m_Character.Move(crouch); +#else m_Character.Move(m_Move, crouch); +#endif + if (crouch && !(m_DisableRewindWhenLatched && m_HasPuppy)) { m_TimeManager.timeStopToggle(crouch); @@ -73,7 +87,13 @@ private void FixedUpdate() switch (m_TimeManager.m_RewindMode) { case TimeManager.RewindType.SCRUB: + +#if USING_DOG_CHARACTER + m_Character.Move(crouch); +#else m_Character.Move(m_Move, crouch); +#endif + if (!crouch) m_TimeManager.timeStopToggle(crouch); if (m_IsRewindController) @@ -85,19 +105,31 @@ private void FixedUpdate() } break; case TimeManager.RewindType.HOLD_AND_RELEASE: + +#if USING_DOG_CHARACTER + m_Character.Move(crouch); +#else m_Character.Move(m_Move, crouch); +#endif + if (!crouch) m_TimeManager.timeStopToggle(crouch); break; case TimeManager.RewindType.TO_ZERO: if (m_TimeManager.m_WaitingForPlayer) { + +#if USING_DOG_CHARACTER + m_Character.Move(crouch); +#else m_Character.Move(m_Move, crouch); +#endif + if (!crouch) { m_TimeManager.timeStopToggle(crouch); } - } + } break; } diff --git a/Assets/Scripts/Dog/DogFP.cs b/Assets/Scripts/Dog/DogFP.cs index 3feae98..fdd4604 100644 --- a/Assets/Scripts/Dog/DogFP.cs +++ b/Assets/Scripts/Dog/DogFP.cs @@ -42,6 +42,11 @@ private void Update() } void FixedUpdate() + { + + } + + public void Move(bool crouch) { if (grounded) {