Exemplo n.º 1
0
    void SpawnNewBase()
    {
        int idx = -1;

        foreach (CoolDownTimer cdt in cdTimerList)
        {
            if (cdt.t == 0)
            {
                if (cdt.coolDownTimer.Equals(0))
                {
                    int x = Random.Range(40, 180);
                    int z = Random.Range(40, 180);

                    LatentCreature c = Instantiate(latentCreature);


                    c.Initialize(new Vector3(x, 0, z));

                    latentCreatureList.Add(c);
                    idx = cdTimerList.IndexOf(cdt);


                    Destroy(cdt.gameObject);
                }
            }
        }

        if (idx >= 0)
        {
            cdTimerList.RemoveAt(idx);
        }
    }
Exemplo n.º 2
0
    void SpawnBase()
    {
        for (int i = 0; i < NUM_BASE; i++)
        {
            int x = Random.Range(40, 180);
            int z = Random.Range(40, 180);

            LatentCreature c = Instantiate(latentCreature);

            //Instantiate(latentCreature);
            //latentCreature.Initialize(new Vector3(x, 0, z));
            c.Initialize(new Vector3(x, 0, z));

            latentCreatureList.Add(c);
        }
    }