void Awake() { try { houseSetup = FindObjectOfType <HouseIdentifier>().houseSetup; GetSceneNames(); } catch { Debug.LogError("Assign a HouseSetup Scriptable Obj to agent!"); } player = FindObjectOfType <RoomIdentifier>(); }
/// <summary> /// When the scene is loaded, place all of the items based on room data for loaded room. /// Place the player in front of the door of the room that they came from /// </summary> void OnEnable() { //fpsController = FindObjectOfType<FirstPersonController>(); fpsController = GameObject.FindGameObjectWithTag("Player"); player = FindObjectOfType <RoomIdentifier>(); lastRoom = player.lastRoom; thisRoomData = player.GetAssociatedRoomData(currentRoom); spawns = GameObject.Find("SpawnPoints"); spawnPoints = spawns.GetComponentsInChildren <Transform>(); SetRoom(); SpawnPlayer(); }