public void Died() { SFXAudioManager.SFXManager.PlaySFX(DeathClipName); Player.ToggleInput(); gameObject.layer = LayerMask.NameToLayer(InvenurableLayer); MyAnimator.SetTrigger(DeathParameter); }
IEnumerator Teletransport() { PlayerMovement.ToggleInput(); AreaManager.EnableNextArea(); Player.transform.position = ExitPoint.transform.position; PlayerStats.EnteredArea(ExitPoint.transform.position); Camera.transform.position = CameraPosition; yield return(new WaitForSeconds(LockInputDurantion)); AreaManager.DisablePreviousArea(); PlayerMovement.ToggleInput(); }
public void StartDialogue(Dialogue dialogue) { ThorInput.ToggleInput(); Sentences.Clear(); ContinueButtonText.text = BeginText; Time.timeScale = 0; foreach (string sentence in dialogue.Sentences) { Sentences.Enqueue(sentence); } DialogueUI.SetActive(true); TextDialogue.SetActive(true); DisplayNextSentence(); }
IEnumerator MoveCamera(Vector3 NewCameraPosition, Vector3 NewPlayerPosition) { Player.transform.position = NewPlayerPosition; Thor.ToggleInput(); AreaManager.EnableNextArea(); float timeElapsed = 0; while (timeElapsed < LerpSmoothness) { Camera.transform.position = Vector3.Lerp(Camera.transform.position, NewCameraPosition, timeElapsed / LerpSmoothness); timeElapsed += Time.deltaTime; yield return(null); } AreaManager.DisablePreviousArea(); Thor.ToggleInput(); ThorStats.EnteredArea(Player.transform.position); }