Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class RoomTemplates : MonoBehaviour
- {
- public GameObject[] bottomRooms;
- public GameObject[] topRooms;
- public GameObject[] leftRooms;
- public GameObject[] rightRooms;
- public GameObject ClosedRoom;
- public List<GameObject> rooms;
- public float waitTime;
- private bool spawnedBoss;
- public GameObject boss;
- void Update()
- {
- if (waitTime <= 0 && spawnedBoss == false)
- {
- for (int i = 0; i < rooms.Count; i++)
- {
- if (i == rooms.Count - 1)
- {
- Instantiate(boss,rooms[i].transform.position, Quaternion.identity);
- spawnedBoss = true;
- }
- }
- }
- else if(spawnedBoss == false)
- {
- waitTime -= Time.deltaTime;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement