Ejemplo n.º 1
0
    //Spider methods
    public SpiderAIBehaviour GetSpider(bool random, Vector3 position)
    {
        if (random)
        {
            return(GetSpider(ChromaColorInfo.Random, position));
        }

        //Get a spider from pool
        SpiderAIBehaviour spider = spiderPool.GetObject(position);

        if (spider != null)
        {
            spider.color = currentColor;
            spider.SetMaterials(new[] { currentSpiderMat });
            return(spider);
        }

        return(null);
    }
Ejemplo n.º 2
0
    public GameObject GetMonsterFromName(string monsterName)
    {
        ObjectPool pool;

        if (_monstersPools.TryGetValue(monsterName, out pool))
        {
            var monster = pool.GetObject();
            monster.SetActive(true);
            return(monster);
        }
        return(SpiderPool.GetObject());
    }