Пример #1
0
 private void OnTriggerExit2D(Collider2D other)
 {
     m_RoBoot = other.gameObject.GetComponentInParent <RoBoot>();
     //if (m_RoBoot != null)
     if (other.transform.name == "Head" && m_RoBoot.m_IsMag)
     {
         if (m_RoBoot.m_Magnet)
         {
             m_RoBoot.m_Magnet = false;
             m_RoBoot.m_Transform.Rotate(new Vector3(0, 0, 180));
         }
     }
 }
Пример #2
0
 private void OnTriggerStay2D(Collider2D other)
 {
     //Debug.Log("Trigger: " + other.name);
     m_RoBoot = other.gameObject.GetComponentInParent <RoBoot>();
     //if (m_RoBoot != null)
     if (other.transform.name == "Head" && m_RoBoot.m_IsMag)
     {
         if (!m_RoBoot.m_Magnet)
         {
             m_RoBoot.m_Magnet = true;
             m_RoBoot.m_Transform.Rotate(new Vector3(0, 0, 180));
         }
     }
 }
Пример #3
0
 private void Awake()
 {
     m_RoBoot = GetComponent <RoBoot>();
 }