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()
|
|
{
|
|
rightHand.UpdateHand(Vector2.up);
|
|
}
|
|
|
|
/// <summary>
|
|
/// OnDisable is called when the behaviour becomes disabled.
|
|
/// </summary>
|
|
private void OnDisable()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Update is called once per frame
|
|
/// </summary>
|
|
private void FixedUpdate()
|
|
{
|
|
|
|
if (oar.isColliding())
|
|
{
|
|
leftHand.UndoLastMovement();
|
|
rightHand.UndoLastMovement();
|
|
oar.UpdateTransform();
|
|
}
|
|
|
|
leftHand.UpdateHand(leftHand.m_desiredInput);
|
|
rightHand.UpdateHand(rightHand.m_desiredInput);
|
|
|
|
oar.UpdateTransform();
|
|
|
|
|
|
}
|
|
|
|
#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
|
|
|
|
}
|