예제 #1
0
    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();
    }
예제 #2
0
    public void DeactivateCamera()
    {
        transform.gameObject.SetActive(false);
        GameObject fourthWall = FourthWall.GetInstance();

        if (fourthWall && !Player.GetInstanceControl().IsCovering())
        {
            fourthWall.SetActive(false);
        }
        Player.GetInstanceControl().SetInTransition(false);
    }
예제 #3
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         instance.gameObject.SetActive(false);
     }
 }
예제 #4
0
    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);
    }