|
@ -34,7 +34,7 @@ public class YeetController : InputBehaviour |
|
|
|
|
|
|
|
|
private LineRenderer m_lineRenderer; |
|
|
private LineRenderer m_lineRenderer; |
|
|
private AudioSource m_audioSource; |
|
|
private AudioSource m_audioSource; |
|
|
private Transform m_OldChildParent; |
|
|
|
|
|
|
|
|
private Transform m_SpawnerTransform; |
|
|
|
|
|
|
|
|
private Vector3 preyeetPosition; |
|
|
private Vector3 preyeetPosition; |
|
|
|
|
|
|
|
@ -46,6 +46,7 @@ public class YeetController : InputBehaviour |
|
|
m_body = this.gameObject; |
|
|
m_body = this.gameObject; |
|
|
m_audioSource = gameObject.AddComponent<AudioSource>(); |
|
|
m_audioSource = gameObject.AddComponent<AudioSource>(); |
|
|
m_audioSource.spatialBlend = 0f; |
|
|
m_audioSource.spatialBlend = 0f; |
|
|
|
|
|
m_SpawnerTransform = FindObjectOfType<spawner>().transform; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void Hold(GameObject child) |
|
|
public void Hold(GameObject child) |
|
@ -53,7 +54,6 @@ public class YeetController : InputBehaviour |
|
|
m_audioSource.clip = childClips[Random.Range(0, childClips.Length)]; |
|
|
m_audioSource.clip = childClips[Random.Range(0, childClips.Length)]; |
|
|
|
|
|
|
|
|
_child = child; |
|
|
_child = child; |
|
|
m_OldChildParent = _child.transform.parent; |
|
|
|
|
|
_child.transform.parent = parent.transform; |
|
|
_child.transform.parent = parent.transform; |
|
|
_child.GetComponent<YeetHandle>().held = true; |
|
|
_child.GetComponent<YeetHandle>().held = true; |
|
|
_child.GetComponent<YeetHandle>().lastHeld = parent; |
|
|
_child.GetComponent<YeetHandle>().lastHeld = parent; |
|
@ -86,7 +86,7 @@ public class YeetController : InputBehaviour |
|
|
m_YeetAnimator.SetBool("Yeet", false); |
|
|
m_YeetAnimator.SetBool("Yeet", false); |
|
|
m_YeetAnimator.SetBool("Carry", false); |
|
|
m_YeetAnimator.SetBool("Carry", false); |
|
|
|
|
|
|
|
|
_child.transform.parent = m_OldChildParent; |
|
|
|
|
|
|
|
|
_child.transform.parent = m_SpawnerTransform; |
|
|
_child.transform.rotation = parent.transform.rotation; |
|
|
_child.transform.rotation = parent.transform.rotation; |
|
|
_child.GetComponent<YeetHandle>().held = false; |
|
|
_child.GetComponent<YeetHandle>().held = false; |
|
|
|
|
|
|
|
|