예제 #1
0
 public void ExitOptionScreen()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
     UIOption.SetActive(false);
     gamePausing.PlayGame();
     optionsDisplayed = false;
 }
예제 #2
0
    private IEnumerator AnimateOutAndDisable()
    {
        journalAnimator.SetTrigger("play_out");
        yield return(new WaitForSeconds(0.5f));

        journalUI.SetActive(false);
        mainUI.SetActive(true);
        gamePausing.PlayGame();
        journalIsDisplayed = false;
    }
    IEnumerator LerpToPosition(Transform destinationCamera, float lerpSpeed, bool isForward)
    {
        float t = 0.0f;
        //Positions
        Vector3 startingCamPos = mainCam.transform.position;
        Vector3 endCamPos      = destinationCamera.position;
        //Rotations
        Quaternion startingCamRot = mainCam.transform.rotation;
        Quaternion endCamRot      = destinationCamera.rotation;


        //First level of Interaction
        if (!currentTarget.isNestedAction && isForward)
        {
            originCamTransform.position = mainCam.transform.position;
            originCamTransform.rotation = mainCam.transform.rotation;
        }

        //Movement over time
        while (t < 1f)
        {
            t += Time.deltaTime * (Time.timeScale / lerpSpeed);
            //Moving the camera
            mainCam.transform.position = Vector3.Lerp(startingCamPos, endCamPos, t);
            mainCam.transform.rotation = Quaternion.Lerp(startingCamRot, endCamRot, t);
            yield return(0);
        }
        //Intermediate Level of Interaction
        if ((isForward && currentTarget.canInteractClose) || (!isForward && currentTarget.isNestedAction))
        {
            gamePausing.EnableCloseInteraction();
            if (isForward && currentTarget.canInteractClose)
            {
                SwitchToCloseCam();
            }
        }
        //Back to original Position
        if (!isForward && !currentTarget.isNestedAction)
        {
            gamePausing.PlayGame();
        }

        if (isForward)
        {
            OnDetectiveRemarkStarted(currentTarget.clue);
        }
    }
 private void OnInstructionPanelEnd()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
     gamePausing.PlayGame();
 }