private void LevelNotCompleted()
    {
        Debug.Log($"YOU DIDN'T COMPLETE THE LEVEL YOU F**K");

        BlackFader.FadeToBlack();

        RestartMechanic.RestartGame();
    }
Пример #2
0
    private void Update()
    {
        if (Input.GetKeyDown(restartKey))
        {
            RestartMechanic.RestartGame();
        }


        timeSinceStart += Time.deltaTime;
        timeToBuzzer   -= Time.deltaTime * timeScaleOfTimer;

        txt.text = timeToBuzzer.ToString("F2");

        if (timeToBuzzer <= 0)
        {
            LevelNotCompleted();
        }
    }
Пример #3
0
    private void Update()
    {
        // Vector3 playerOffsetFromPortal = playerCamera.position - entrancePortal.position;
        // transform.position = exitPortal.position + playerOffsetFromPortal;
        //
        // float angularDifferenceBetweenPortalRotations = Quaternion.Angle(exitPortal.rotation, entrancePortal.rotation);
        //
        // Quaternion portalRotationalDifference = Quaternion.AngleAxis(angularDifferenceBetweenPortalRotations, Vector3.up);
        // Vector3 newCameraDirection = portalRotationalDifference * playerCamera.forward;
        // transform.rotation = Quaternion.LookRotation(newCameraDirection, Vector3.up);

        var m = exitPortal.localToWorldMatrix * entrancePortal.worldToLocalMatrix * playerCamera.localToWorldMatrix;

        this.transform.rotation = m.rotation;

        if (Input.GetKeyDown(KeyCode.R))
        {
            RestartMechanic.RestartGame();
        }
    }