コード例 #1
0
ファイル: Cover.cs プロジェクト: nmtc01/Clandestine-Operation
    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
    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);
    }