Exemple #1
0
    public bool Spawned(ObjectPool_AI[] objectPools, Transform[] spots, ObjectPool_AI_Pickables p, Transform[] pickableSpots)
    {
        if (counter == spawnPattern.Length)
        {
            return(true);
        }

        while (counter < spawnPattern.Length)
        {
            Vector3 pos = spots[Random.Range(0, spots.Length)].position;
            if (!objectPools[spawnPattern[counter]].Spawn(new Vector3(pos.x + Random.Range(-5, 5), pos.y, pos.z + Random.Range(-5, 5))))
            {
                return(false);
            }
            counter++;
        }

        int c = 0;

        while (c < pickables)
        {
            p.Spawn(pickableSpots[Random.Range(0, pickableSpots.Length)].position);
            Debug.Log("Spawn Pickable");
            c++;
        }

        return(false);
    }
Exemple #2
0
    //public static WaveManager instance;
    //private void Awake()
    //{
    //    instance = this;
    //}

    void Start()
    {
        objectPools           = GetComponentsInChildren <ObjectPool_AI>();
        pickablePool          = GetComponentInChildren <ObjectPool_AI_Pickables>();
        EventHandler.OnDeath += OnDeath;
    }
Exemple #3
0
 public void SetPool(ObjectPool_AI_Pickables p)
 {
     pool = p;
     InitHealth(10);
 }