// Use this for initialization void Start() { // create grid for (int z = 0; z < _height; z++) { for (int x = 0; x < _widht; x++) { Vector3 pos = new Vector3(x, 0, z); GameObject go = (GameObject)Instantiate(Resources.Load("CreepCell"), pos, Quaternion.identity); creep[x, z] = go.GetComponent<CreepCell>(); go.transform.parent = transform; } } // make it spreadable spread = new CreepSpread(_height, _widht, creep); }
// Use this for initialization void Start() { // create grid for (int z = 0; z < _height; z++) { for (int x = 0; x < _widht; x++) { Vector3 pos = new Vector3(x, 0, z); GameObject go = (GameObject)Instantiate(Resources.Load("CreepCell"), pos, Quaternion.identity); creep[x, z] = go.GetComponent <CreepCell>(); go.transform.parent = transform; } } // make it spreadable spread = new CreepSpread(_height, _widht, creep); }