public void MakeObstacle(ObstaclePlacer placer) { if (obstacle == null) { obstacle = Instantiate(obstaclePrefab, this.transform.position, obstaclePrefab.transform.rotation, this.transform); placer.tilesToPlace--; } else { Debug.LogWarning("That tile already has a obstacle"); } }
private void Awake() { roadLooper = Object.FindObjectOfType <RoadLooper>(); obstaclePlacer = Object.FindObjectOfType <ObstaclePlacer>(); obstacleGenretor = new ObstacleGenretor(10, 10); }
void Start() { myObstaclePlacer = GameObject.FindGameObjectWithTag("Manager").GetComponent <ObstaclePlacer>(); //text = GameObject.FindGameObjectWithTag("UIText").GetComponent<Text>(); }