Exemple #1
0
    public void Btn_RenameHero()
    {
        ConfirmYesNoInterface renamePrompt = ConfirmYesNoInterface.AskCustom("Rename Hero", "Interface_ConfirmTextPrompt");

        renamePrompt.SetCharLimit(24);
        var input = renamePrompt.GetInputText();

        input.text = selectedHero.Name;

        renamePrompt
        .Then(answer => {
            if (answer == "YES")
            {
                RenameHero(input.text);
            }
        })
        .Catch(err => {
            traceError("Nope! Not renaming hero: " + err.Message);
        });
    }
    private void CheckEmergencyWipeInput()
    {
        if (!isAllowEmergencyWipe || _emergencyConfirm != null || !Input.GetMouseButton(0))
        {
            _emergencyWipeSeconds = 0;
            return;
        }

        _emergencyWipeSeconds += Time.deltaTime;

        if (_emergencyWipeSeconds > 2.0)
        {
            _emergencyConfirm = ConfirmYesNoInterface.Ask("Wipe Data?", "Would you like to\nwipe all PlayerPrefs?");
            _emergencyConfirm.Then(answer => {
                if (answer == "YES")
                {
                    PlayerPrefs.DeleteAll();
                    audioMan.Play(SFX_UI.Explosion);
                }

                this.Wait(1.0f, () => _emergencyConfirm = null);
            });
        }
    }