protected virtual void Awake() { m_rigidbody2D = GetComponent <Rigidbody2D>(); m_animator = GetComponent <Animator>(); m_input = GetComponent <VirtualInput>(); if (m_rigidbody2D == null) { Debug.LogError("No Rigidbody2D found on " + name, this); } if (m_animator == null) { Debug.LogError("No Animator found on " + name, this); } }
public void OnDetachPlayer(PlayerBodyConnection connection) { m_virtualInput = null; }
public void OnAttachPlayer(PlayerBodyConnection connection) { m_virtualInput = (connection.body != null) ? connection.body.GetComponent <VirtualInput>() : null; m_movement = (connection.body != null) ? connection.body.GetComponent <Movement>() : null; }
protected virtual void Awake() { m_virtualInput = GetComponentInParent <VirtualInput>(); m_movement = GetComponentInParent <Movement>(); }
private void Awake() { m_input = GetComponent <VirtualInput>(); }