public void SendHighScore(TMP_InputField name) { if (name.text == "") { name.text = "Mr. Default"; } HighScore hs = Resources.Load <HighScore>("HighScore"); int i = 0; while (hs.score[i] > _Counter._count && i < hs.score.Length) { i++; } for (int j = 19; j > i; j--) { hs.score[j] = hs.score[j - 1]; hs.joueur[j] = hs.joueur[j - 1]; } hs.score[i] = _Counter._count; hs.joueur[i] = name.text; Destroy(name.gameObject); _sceneFader.FadeOut("MainMenu"); }
// Start is called before the first frame update void Start() { var sequence = DOTween.Sequence(); sequence.AppendInterval(_duration); sequence.OnComplete(() => _fader.FadeOut("MainMenu", _fadeDuration)); }
private void Update() { if (_isEnabled) { bool anyPress = false; foreach (var gamepad in Gamepad.all) { if (gamepad.allControls.Any(x => x is ButtonControl button && ((ButtonControl)x).wasPressedThisFrame && !x.synthetic)) { anyPress = true; } } if (anyPress) { _sceneFader.FadeOut("PlayerSelectionMenu"); } if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } } }
private void Back() { OnBack?.Invoke(); _sceneFader.FadeOut("MainMenu", .2f); }