private void Interact() { isCovering = !isCovering; // Activate covering features GameObject fourthWall = FourthWall.GetInstance(); if (fourthWall) { fourthWall.SetActive(isCovering); } Player.GetInstanceControl().SetIsCovering(isCovering); if (healthUI) { healthUI.SetActive(isCovering); } // Change player position and rotation Transform player = Player.GetInstance().transform; player.position = new Vector3(transform.position.x - slack, player.position.y, player.position.z); if (playerSkeleton && playerSkeleton.transform.right.z > 0) { playerSkeleton.transform.right = -1 * playerSkeleton.transform.right; } // Change player colliders to fit new position HandlePlayerColliders(); }
public void DeactivateCamera() { transform.gameObject.SetActive(false); GameObject fourthWall = FourthWall.GetInstance(); if (fourthWall && !Player.GetInstanceControl().IsCovering()) { fourthWall.SetActive(false); } Player.GetInstanceControl().SetInTransition(false); }
public void ActivateCamera() { GameObject fourthWall = FourthWall.GetInstance(); if (fourthWall) { fourthWall.SetActive(true); } PlayerControl playerControl = Player.GetInstanceControl(); playerControl.SetInTransition(true); playerControl.ResetPlayerMovements(); transform.gameObject.SetActive(true); }