Example #1
0
 void Start()
 {
     bulletPool    = transform.FindChild("Bullets").GetComponent <BulletPool>();
     enemyPool     = transform.FindChild("Enemies").GetComponent <EnemyPool>();
     greenPool     = transform.FindChild("Greens").GetComponent <GreenPool>();
     lootPool      = transform.FindChild("Loot").GetComponent <LootPool>();
     objectSpawner = GetComponent <ObjectSpawner>();
     generateMap(MapType.rockyForest);
 }
Example #2
0
    public void init(int[,] mapToCopy)
    {
        //bulletPool = transform.FindChild("Bullets").GetComponent<BulletPool>();
        enemyPool = transform.FindChild("Enemies").GetComponent <EnemyPool>();
        greenPool = transform.FindChild("Greens").GetComponent <GreenPool>();
        //lootPool = transform.FindChild("Loot").GetComponent<LootPool>();

        if (useRandomSeed)
        {
            seed = Time.time.ToString();
        }
        width  = mapToCopy.GetLength(0);
        height = mapToCopy.GetLength(1);
        map    = new int[width, height];
        Buffer.BlockCopy(mapToCopy, 0, map, 0, mapToCopy.Length * sizeof(int));
        freeTiles = new List <Coord>();
        fillFreeTiles();
    }