Esempio n. 1
0
 //Initializes all required references to external scripts.
 public void Init(TankManager manager)
 {
     m_Manager        = manager;
     m_TankDisplay    = manager.display;
     m_StartingHealth = manager.playerTankType.hitPoints;
     m_Collider       = m_TankDisplay.GetComponent <BoxCollider>();
 }
Esempio n. 2
0
        private void SetTankActive(bool active)
        {
            if (m_Collider == null && m_TankDisplay != null)
            {
                m_Collider = m_TankDisplay.GetComponent <BoxCollider>();
            }
            if (m_Collider != null)
            {
                m_Collider.enabled = active;
            }

            m_TankDisplay.SetVisibleObjectsActive(active);

            m_AimCanvas.SetActive(active);

            if (active)
            {
                m_Manager.EnableControl();
            }
            else
            {
                m_Manager.DisableControl();
            }
        }