public float GetYBobAmount() { if (InDialogue.Value) { return(0f); } var waveslice = 0.0f; if (Math.Abs(Controller.velocity.magnitude) < 0.01f) { if (Math.Abs(timer) > 0.01f) { PlayerStep.Raise(); } timer = 0.0f; //Standing still step sound } else { waveslice = Mathf.Sin(timer); timer = timer + speed * Time.deltaTime; if (timer > Mathf.PI * 2) { timer = timer - (Mathf.PI * 2); PlayerStep.Raise(); //playerSFX.pitch = Random.Range(0.8f, 1.2f); //playerSFX.PlayOneShot(footstepConcrete, 0.50f); } } if (waveslice != 0) { float translateChange = waveslice * (amount / 100); float totalAxes = Controller.velocity.magnitude; totalAxes = Mathf.Clamp(totalAxes, 0.0f, 1.0f); translateChange = totalAxes * translateChange; return(translateChange); } return(0); }
public void ContinueLevel() { SceneIndex savedMapIndex = LevelLoader.GetSavedScene(); Debug.Log($"[STAGECOMPLETE] Index: {savedMapIndex}"); TransitionLoader.UseMainMenuEvents = true; GameManager.current.MoveScene(savedMapIndex, false); onLevelContinue?.Raise(savedMapIndex); }
public void StartLevel() { savedMapIndex = LevelLoader.GetSavedScene(); Debug.Log($"[MAINMENU] Index: {savedMapIndex}"); TransitionLoader.UseMainMenuEvents = true; GameManager.current.MoveScene(savedMapIndex, false); onLevelContinue?.Raise(savedMapIndex); }
private void OnMouseDown() { _InspectModeInteractionPointEvent.Value = this; InDialogue.Value = true; if (EventOnPress != null) { EventOnPress.Raise(); } }
IEnumerator FadeTransition() { while (_cg.alpha < 1) { _cg.alpha += Time.deltaTime; yield return(null); } MakeDioramaAppear.Raise(); yield return(new WaitForSeconds(1)); while (_cg.alpha > 0) { _cg.alpha -= Time.deltaTime; yield return(null); } }
void Start() { MovePlayer.Raise(); }
public void MouseClick() { MouseExit(); SelectChoice.Raise(); }