// Update is called once per frame void Update() { transform.LookAt(player.transform); if (game.Failure() && !gameOver) { gameOver = true; StartCoroutine(Attack()); } }
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; //} } }