Exemplo n.º 1
0
    IEnumerator EvolveTower(TowerEvolutions nextEvolution)
    {
        if (currentEvolution == nextEvolution)
        {
            yield break;
        }

        currentEvolution = nextEvolution;
        currentSettings  = GetTowerSettings(nextEvolution);
        health.RestoreHealth();
        modifier.SetTintColor(new Color(1, 1, 0, 1f), 0.75f);

        yield return(new WaitForSeconds(0.75f));

        switch (nextEvolution)
        {
        case TowerEvolutions.Evolution2:
            towerAnimator.SetBool("EvolvedTo2", true);
            break;

        case TowerEvolutions.Evolution3:
            towerAnimator.SetBool("EvolvedTo3", true);
            break;
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        health        = GetComponent <Health>();
        towerAnimator = towerGFX.GetComponent <Animator>();
        modifier      = GetComponentInChildren <MaterialModifier>();

        currentEvolution = TowerEvolutions.Evolution1;
        currentSettings  = GetTowerSettings(currentEvolution);
    }
Exemplo n.º 3
0
 Tower GetTowerSettings(TowerEvolutions evolution)
 {
     foreach (var settings in towersSettings)
     {
         if (settings.evolution == evolution)
         {
             return(settings);
         }
     }
     return(null);
 }
Exemplo n.º 4
0
 public void SetLastEvolution(TowerEvolutions lastEvolution)
 {
     this.lastEvolution = lastEvolution;
 }