Пример #1
0
    public void Init(TankManager manager, TankDisplay display)
    {
        m_Manager     = manager;
        m_TankDisplay = display;
        m_Collider    = m_TankDisplay.GetComponent <BoxCollider>();

        SetDefaults();
    }
Пример #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();
        }
    }