TileUnit genNode(string type, Vector3 pos) { TileUnit tu = new TileUnit(); GameObject t = null; switch (type) { case "red": t = Instantiate(Resources.Load("RedCube"), pos, Quaternion.identity) as GameObject; tu.init(t, null, null, null, null, false); break; case "green": t = Instantiate(Resources.Load("GreenCube"), pos, Quaternion.identity) as GameObject; tu.init(t, null, null, null, null, true); break; } switch (type) { case "green": greenTiles.Add(tu); break; case "red": redTiles.Add(tu); break; } return(tu); }
TileUnit genNode(string type, Vector3 pos) { TileUnit tu = new TileUnit(); GameObject t = null; switch(type) { case "red": t = Instantiate (Resources.Load("RedCube"), pos ,Quaternion.identity) as GameObject; tu.init(t,null,null,null,null,false); break; case "green": t = Instantiate (Resources.Load("GreenCube"), pos ,Quaternion.identity) as GameObject; tu.init(t,null,null,null,null,true); break; } switch(type) { case "green": greenTiles.Add(tu); break; case "red": redTiles.Add(tu); break; } return tu; }