void CreateVisualizationForType(){

		EraseDefaultViz ();

		if (m_tileSingle == null) {
			m_tileSingle = FindObjectOfType (typeof(TileSingleton)) as TileSingleton;
		}

		if (m_tileType == TileType.TILE_RANDOM) {
			m_tileType = (TileType)Random.Range (0, 6);
			CreateVisualizationForType ();
			return;
		}

		m_tileVizPrefab = Instantiate (m_tileSingle.GetPrefabOfType (m_tileType), transform.position, Quaternion.identity) as GameObject;
		m_tileVizPrefab.transform.parent = gameObject.transform;
		m_vizController = m_tileVizPrefab.GetComponent<TileVizController> ();
		m_vizController.InitializeViz ();
	}
Beispiel #2
0
	public override void CreateVizForTile (TileSingleton tS) {
		for (int i = 0; i < Node.NUM_CHILDREN; i++) {
			if (this.children [i] != null) {
				this.children [i].CreateVizForTile (tS);
			}
		}
	}
Beispiel #3
0
	public abstract void CreateVizForTile (TileSingleton tS);
Beispiel #4
0
	public override void CreateVizForTile (TileSingleton tS) {
		Vector3 worldVec = GridController.GridToWorld (this.addr);
		TileTypeController newTile = (GameObject.Instantiate (tS.m_tileParent, worldVec, Quaternion.identity) as GameObject).GetComponent<TileTypeController>() as TileTypeController;
		newTile.InitializeTileController (true);
		this.UpdateTileViz (newTile);
	}