Exemple #1
0
    private IEnumerator SpawnLoop()
    {
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnSoldier();
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnWizard();
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnArcher();
        yield return(new WaitForSeconds(1f));

        List <GameObject> Units = Spawner.GetAllSpawnedUnits();

        foreach (GameObject u in Units)
        {
            if (u != null)
            {
                if (u.transform.localScale.x < 2f)
                {
                    StartCoroutine(SpellEffectsService.GetInstance().EmbiggenEffect(u));
                }
            }
        }
        SpawnRoutine = StartCoroutine(SpawnLoop());
    }
 public void CastEmbiggen()
 {
     if (CanCast())
     {
         LevelManagerService.GetInstance().CurrentPlayerMana -= 3;
         List <GameObject> units = PlayerSpawner.GetAllSpawnedUnits();
         foreach (GameObject u in units)
         {
             if (u != null)
             {
                 StartCoroutine(SpellEffectsService.GetInstance().EmbiggenEffect(u));
             }
         }
     }
 }
 public void CastFreeze()
 {
     if (CanCast())
     {
         OpponentSpawner.LockSpawner();
         LevelManagerService.GetInstance().CurrentPlayerMana -= 3;
         StartCoroutine(UnlockSpawnerAfter(10f));
         List <GameObject> units = OpponentSpawner.GetAllSpawnedUnits();
         foreach (GameObject u in units)
         {
             if (u != null)
             {
                 SpellEffectsService.GetInstance().FreezeEffect(u, 10f);
             }
         }
     }
 }
 public void Awake()
 {
     Instance = this;
 }