|
|
@ -30,8 +30,8 @@ public class PlayerInputController : MonoBehaviour |
|
|
|
|
|
|
|
private YeetController m_yeetController; |
|
|
|
|
|
|
|
public GameObject child; |
|
|
|
public GameObject body; |
|
|
|
private GameObject m_child; |
|
|
|
private GameObject m_body; |
|
|
|
|
|
|
|
private void Awake() |
|
|
|
{ |
|
|
@ -39,7 +39,7 @@ public class PlayerInputController : MonoBehaviour |
|
|
|
m_controller = GetComponent<CharacterController>(); |
|
|
|
m_yeetController = GetComponent<YeetController>(); |
|
|
|
|
|
|
|
body = this.gameObject; |
|
|
|
m_body = this.gameObject; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -59,23 +59,23 @@ public class PlayerInputController : MonoBehaviour |
|
|
|
|
|
|
|
private void OnTriggerEnter(Collider collider) |
|
|
|
{ |
|
|
|
Debug.Log("Bang!"); |
|
|
|
child = collider.gameObject; |
|
|
|
Debug.Log("PlayerInputController.OnTriggerEnter: arrived"); |
|
|
|
m_child = collider.gameObject; |
|
|
|
} |
|
|
|
|
|
|
|
private void OnTriggerExit(Collider collider) |
|
|
|
{ |
|
|
|
child = null; |
|
|
|
m_child = null; |
|
|
|
} |
|
|
|
|
|
|
|
private void OnYeet() |
|
|
|
{ |
|
|
|
m_yeetController.parent = body; |
|
|
|
m_yeetController.parent = m_body; |
|
|
|
switch (m_yeetController.yeetState) |
|
|
|
{ |
|
|
|
case YeetController.YeetState.Unheld: |
|
|
|
if(child) |
|
|
|
m_yeetController.Hold(child); |
|
|
|
if(m_child) |
|
|
|
m_yeetController.Hold(m_child); |
|
|
|
// Grab nearest baby
|
|
|
|
break; |
|
|
|
case YeetController.YeetState.Held: |
|
|
|