Exemple #1
0
 private void OnTriggerExit(Collider other)
 {
     if (!game.Victory() && other.tag == "Player")
     {
         outOfBounds = true;
     }
 }
    private void Update()
    {
        if (game.Failure())
        {
            StareAtTundra();
        }
        else if (game.Victory() && !victory)
        {
            gameUI.SetActive(false);
            victory = true;
            StartCoroutine(Victory());
        }
        else if (game.StartWalking())
        {
            StartCoroutine(WalkThePlayer(game.GetDirection()));
            game.StopWalking();
        }
        else
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                if (!lookBegan)
                {
                    currentLook = transform.rotation;
                    lookBegan   = true;
                }
                StareAtTundra();
            }
            else if (Input.GetKeyUp(KeyCode.Space))
            {
                transform.rotation = currentLook;
                lookBegan          = false;
                gameUI.SetActive(true);
            }
        }

        if (turnSet)
        {
            transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, rotationSpeed * Time.deltaTime);
            //if(game.Victory())
            //{
            //    lightDoor.transform.parent = null;
            //}
        }
    }