public TerrainType(TerrainStaticData data) { gameplayData = data; this.prefabs = new TerrainPrefabs(gameplayData.name); TypeContainer <TerrainType> .add(this.gameplayData.name, this); }
// Start is called before the first frame update void Start() { prefabs = this.GetComponent <TerrainPrefabs>(); for (int i = -3; i < 4; i++) { for (int j = -3; j < 4; j++) { Debug.Log("i: " + i + " j: " + j); if (i == 0 && j == 0) { Instantiate(prefabs.main_tile, new Vector3(0, 0, 0), Quaternion.identity); } else { Instantiate(prefabs.tree_tile, new Vector3(i, 0, j), Quaternion.identity); } } } // for(int i = -1; i > -5; i--){ // for(int j = 0; j > -5; j--){ // Instantiate(prefabs.tree_tile, new Vector3(i, 0, j), Quaternion.identity); // } // } }
/// <summary> /// Destructor for TerrainPrefabs /// </summary> /// <param name="terrainPrefabs"></param> public static void Destroy(TerrainPrefabs terrainPrefabs) { GameObject.Destroy(terrainPrefabs.block); foreach (GameObject wall in terrainPrefabs.walls) { GameObject.Destroy(wall); } terrainPrefabs = null; }
public TerrainType(TerrainStaticData data, TerrainPrefabs prefabs) { gameplayData = data; if (prefabs == null) { this.prefabs = new TerrainPrefabs(gameplayData.name); } TypeContainer <TerrainType> .add(gameplayData.name, this); }
public TerrainType(TerrainStaticData data, TerrainPrefabs prefabs) { gameplayData = data; if (prefabs == null) this.prefabs = new TerrainPrefabs( gameplayData.name ); TypeContainer<TerrainType>.add( gameplayData.name, this ); }
public TerrainType(TerrainStaticData data) { gameplayData = data; this.prefabs = new TerrainPrefabs( gameplayData.name ); TypeContainer<TerrainType>.add( this.gameplayData.name, this ); }
/// <summary> /// Destructor for TerrainPrefabs /// </summary> /// <param name="terrainPrefabs"></param> public static void Destroy(TerrainPrefabs terrainPrefabs) { GameObject.Destroy( terrainPrefabs.block ); foreach (GameObject wall in terrainPrefabs.walls) GameObject.Destroy( wall ); terrainPrefabs = null; }