internal void PlayerHidesInLocker() { var playerTransform = playerController.transform; var stateInTime = new CharacterInTime( $"Player{GetTimeTravelCount() + 1}", GetTime(), CharacterType.Player, new Vector3(playerTransform.position.x, playerTransform.position.y, playerTransform.position.z), playerTransform.rotation, ActionType.EnterLocker ); momentsInTime.AddObject(stateInTime); }
private void TakeSnapshot() { { var playerTransform = playerController.transform; var l = (ActionType)(int)playerController.LatestAction; var stateInTime = new CharacterInTime($"Player{GetTimeTravelCount() + 1}", GetTime(), CharacterType.Player, new Vector3(playerTransform.position.x, playerTransform.position.y, playerTransform.position.z), playerTransform.rotation, l); //playerController.ResetLatestAction(); momentsInTime.AddObject(stateInTime); } { var largeDoors = GameObject.FindObjectsOfType <LargeDoor>(); foreach (var largeDoor in largeDoors) { var stateInTime = new DoorObjectInTime(largeDoor.gameObject.name, GetTime(), InanimateObjectType.LargeDoor, largeDoor.IsOpenByPresentAction()); momentsInTime.AddObject(stateInTime); } } { var lockers = GameObject.FindObjectsOfType <Locker>(); foreach (var locker in lockers) { var stateInTime = new LockerInTime(locker.gameObject.name, GetTime(), locker.OccupiedByPresentPlayer); momentsInTime.AddObject(stateInTime); } } var security = FindObjectOfType <SecuritySystem>(); if (security != null) { var stateInTime = new SecuritySystemInTime(security.gameObject.name, GetTime(), security.AlarmByPresentAction); momentsInTime.AddObject(stateInTime); } }