void PlaceRoad(int x, int y) { MapItem tmp = Instantiate(roadStraight, new Vector3(x, 0, y), Quaternion.identity); tmp.GetComponent <Road>().trashPrefabs = ThrashPrefabs; GameMap[x, y] = tmp; }
void PlaceRoad(int x, int y, MapItem roadType, RoadOrientation orientation) { //, new Quaternion(0, rotation, 0, 0) MapItem tmp = Instantiate(roadType, new Vector3(x, 0, y), Quaternion.identity); tmp.transform.Rotate(new Vector3(0, (int)orientation, 0)); tmp.GetComponent <Road>().trashPrefabs = ThrashPrefabs; GameMap[x, y] = tmp; }
void PlaceBuilding(int x, int y) { Road r = FindAdjacentRoad(x, y); if (r != null) { if (housePrefabs.Count > 0) { float result = Random.Range(0, housePrefabs.Count); MapItem tmp = Instantiate(housePrefabs[Mathf.RoundToInt(result)], new Vector3(x, 0, y), Quaternion.identity); tmp.GetComponent <Building>().SetDumpLocation(r); GameMap[x, y] = tmp; } } }