Ejemplo n.º 1
0
    public void TowerCheckpointCaptured(TowerBase tower)
    {
        UIManager.Instance.UINotifyHeader("Checkpoint Captured!");
        UIManager.Instance.UINotifySecondary("The next checkpoint has been revealed.");
        Debug.Log("Checkpoint tower captured");
        tower.TowerCaptured -= TowerCheckpointCaptured;
        // Prevent notification from calling again
        tower.TowerEntered = null;
        tower.TowerExited  = null;
        SetCurrentTower(null);
        tower.RevealNext();

        // Replace tower with checkpoint
        TowerHost   th = tower.GetComponent <TowerHost>();
        TowerClient tc = tower.GetComponent <TowerClient>();

        if (th != null)
        {
            Destroy(th);
        }
        if (tc != null)
        {
            Destroy(tc);
        }

        int priority = tower.GetPriority();

        if (m_CurrentCheckpointPriority <= priority)
        {
            tower.GetComponent <Checkpoint>().Activate();
            m_CurrentCheckpointPriority = priority;
        }
    }
Ejemplo n.º 2
0
 private void Start()
 {
     m_Tower     = GetComponent <TowerBase>();
     m_TowerHost = GetComponent <TowerHost>();
 }