Skip to content

Commit

Permalink
#1 #3 Modified time mechanics to use new dog FPS character
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisas committed Mar 14, 2017
1 parent c9e9809 commit 9fc7e55
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
17 changes: 16 additions & 1 deletion Assets/PATimeRefactor/Assets/Prefabs/Clone.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
40 changes: 36 additions & 4 deletions Assets/PATimeRefactor/Assets/Scripts/PlayerUserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -20,7 +24,11 @@ public class PlayerUserController : MonoBehaviour

private void Start()
{
#if USING_DOG_CHARACTER
m_Character = GetComponent<DogFP>();
#else
m_Character = GetComponent<Character>();
#endif
m_HasPuppy = false;
}

Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand All @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/Dog/DogFP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ private void Update()
}

void FixedUpdate()
{

}

public void Move(bool crouch)
{
if (grounded)
{
Expand Down

0 comments on commit 9fc7e55

Please sign in to comment.