|
|
@ -30,16 +30,11 @@ public class PlayerInputController : MonoBehaviour |
|
|
|
|
|
|
|
private YeetController m_yeetController; |
|
|
|
|
|
|
|
private GameObject m_child; |
|
|
|
private GameObject m_body; |
|
|
|
|
|
|
|
private void Awake() |
|
|
|
{ |
|
|
|
m_input = GetComponent<PlayerInput>(); |
|
|
|
m_controller = GetComponent<CharacterController>(); |
|
|
|
m_yeetController = GetComponent<YeetController>(); |
|
|
|
|
|
|
|
m_body = this.gameObject; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -57,36 +52,6 @@ public class PlayerInputController : MonoBehaviour |
|
|
|
m_desiredDirection = new Vector3(m_recievedInput.x, 0.0f, m_recievedInput.y); |
|
|
|
} |
|
|
|
|
|
|
|
private void OnTriggerEnter(Collider collider) |
|
|
|
{ |
|
|
|
Debug.Log("PlayerInputController.OnTriggerEnter: arrived"); |
|
|
|
m_child = collider.gameObject; |
|
|
|
} |
|
|
|
|
|
|
|
private void OnTriggerExit(Collider collider) |
|
|
|
{ |
|
|
|
m_child = null; |
|
|
|
} |
|
|
|
|
|
|
|
private void OnYeet() |
|
|
|
{ |
|
|
|
m_yeetController.parent = m_body; |
|
|
|
switch (m_yeetController.yeetState) |
|
|
|
{ |
|
|
|
case YeetController.YeetState.Unheld: |
|
|
|
if(m_child) |
|
|
|
m_yeetController.Hold(m_child); |
|
|
|
// Grab nearest baby
|
|
|
|
break; |
|
|
|
case YeetController.YeetState.Held: |
|
|
|
m_yeetController.Yeet(); |
|
|
|
// Yeet baby
|
|
|
|
break; |
|
|
|
case YeetController.YeetState.Yeeting: |
|
|
|
// Cooldown?
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void ApplyRotation() |
|
|
|
{ |
|
|
|