size 21726 |
@ -0,0 +1,90 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
using NaughtyAttributes; | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public class BoatRowController : MonoBehaviour | |||
{ | |||
#region Inspector Fields | |||
public Collider m_oar; | |||
public Transform m_oarTip; | |||
#endregion Inspector Fields | |||
#region Private Fields | |||
private Vector3 m_lastKnownOarPosition; | |||
#endregion Private Fields | |||
#region Getters | |||
#endregion Getters | |||
#region MonoBehaviour Functions | |||
/// <summary> | |||
/// OnEnable is called when the object becomes enabled and active. | |||
/// </summary> | |||
private void OnEnable() | |||
{ | |||
} | |||
/// <summary> | |||
/// OnDisable is called when the behaviour becomes disabled. | |||
/// </summary> | |||
private void OnDisable() | |||
{ | |||
} | |||
/// <summary> | |||
/// Update is called once per frame | |||
/// </summary> | |||
private void Update() | |||
{ | |||
} | |||
#endregion MonoBehaviour Functions | |||
#region Class Functionality | |||
private void OnTriggerEnter(Collider other) | |||
{ | |||
if(other == m_oar) | |||
{ | |||
m_lastKnownOarPosition = m_oarTip.position; | |||
} | |||
} | |||
void OnTriggerStay(Collider other) | |||
{ | |||
if(other == m_oar) | |||
{ | |||
Vector3 direction = m_lastKnownOarPosition - m_oarTip.position; | |||
direction = Vector3.Project(direction,transform.forward); | |||
} | |||
} | |||
#endregion Class Functionality | |||
#region Editor Functions | |||
/// <summary> | |||
/// Called when the Component is created or Reset from the Inspector | |||
/// </summary> | |||
private void Reset() | |||
{ | |||
//useful for finding components on creation | |||
} | |||
#endregion Editor Functions | |||
} |
@ -0,0 +1,11 @@ | |||
fileFormatVersion: 2 | |||
guid: 519e6a3b156d9684f9781dd40072e27a | |||
MonoImporter: | |||
externalObjects: {} | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,84 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
using NaughtyAttributes; | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public class PlayerController : MonoBehaviour | |||
{ | |||
#region Inspector Fields | |||
public OarController oar; | |||
public HandController leftHand; | |||
public HandController rightHand; | |||
#endregion Inspector Fields | |||
#region Private Fields | |||
#endregion Private Fields | |||
#region Getters | |||
#endregion Getters | |||
#region MonoBehaviour Functions | |||
/// <summary> | |||
/// OnEnable is called when the object becomes enabled and active. | |||
/// </summary> | |||
private void OnEnable() | |||
{ | |||
} | |||
/// <summary> | |||
/// OnDisable is called when the behaviour becomes disabled. | |||
/// </summary> | |||
private void OnDisable() | |||
{ | |||
} | |||
/// <summary> | |||
/// Update is called once per frame | |||
/// </summary> | |||
private void FixedUpdate() | |||
{ | |||
leftHand.UpdateHand(leftHand.m_desiredInput); | |||
rightHand.UpdateHand(rightHand.m_desiredInput); | |||
oar.UpdateTransform(); | |||
if (oar.isColliding()) | |||
{ | |||
leftHand.UndoLastMovement(); | |||
rightHand.UndoLastMovement(); | |||
} | |||
} | |||
#endregion MonoBehaviour Functions | |||
#region Class Functionality | |||
#endregion Class Functionality | |||
#region Editor Functions | |||
/// <summary> | |||
/// Called when the Component is created or Reset from the Inspector | |||
/// </summary> | |||
private void Reset() | |||
{ | |||
//useful for finding components on creation | |||
} | |||
#endregion Editor Functions | |||
} |
@ -0,0 +1,11 @@ | |||
fileFormatVersion: 2 | |||
guid: c7961a202d27d534bae8d79b6e85a629 | |||
MonoImporter: | |||
externalObjects: {} | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
size 1323 |