コード例 #1
0
ファイル: CreepSpreader.cs プロジェクト: kjellski/CreepTest
 // 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);
 }
コード例 #2
0
ファイル: CreepSpreader.cs プロジェクト: kjellski/CreepTest
 // 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);
 }