Example #1
0
    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");
    }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        var sequence = DOTween.Sequence();

        sequence.AppendInterval(_duration);
        sequence.OnComplete(() => _fader.FadeOut("MainMenu", _fadeDuration));
    }
Example #3
0
    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();
            }
        }
    }
Example #4
0
 private void Back()
 {
     OnBack?.Invoke();
     _sceneFader.FadeOut("MainMenu", .2f);
 }