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);
     }
 }
コード例 #2
0
 public void OnDetachPlayer(PlayerBodyConnection connection)
 {
     m_virtualInput = null;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 protected virtual void Awake()
 {
     m_virtualInput = GetComponentInParent <VirtualInput>();
     m_movement     = GetComponentInParent <Movement>();
 }
コード例 #5
0
 private void Awake()
 {
     m_input = GetComponent <VirtualInput>();
 }