コード例 #1
0
ファイル: SaveDialog.cs プロジェクト: trifox/evolution
    public void Show(SaveDialogDelegate Delegate)
    {
        gameObject.SetActive(true);
        this.Delegate = Delegate;
        ResetErrors();
        KeyInputManager.shared.Register();
        InputRegistry.shared.Register(InputType.All, this);
        GestureRecognizerCollection.shared.GetAndroidBackButtonGestureRecognizer().OnGesture += OnAndroidBack;

        inputField.onValidateInput += delegate(string input, int charIndex, char addedChar) {
            if (Delegate.CanEnterCharacter(this, charIndex, addedChar))
            {
                return(addedChar);
            }
            else
            {
                return('\0');
            }
        };

        inputField.onValueChanged.AddListener(delegate {
            Delegate.DidChangeValue(this, inputField.text);
        });

        inputField.text = Delegate.GetSuggestedName(this);
    }
コード例 #2
0
ファイル: SaveDialog.cs プロジェクト: trifox/evolution
 public void Close()
 {
     Delegate = null;
     KeyInputManager.shared.Deregister();
     InputRegistry.shared.Deregister(this);
     GestureRecognizerCollection.shared.GetAndroidBackButtonGestureRecognizer().OnGesture -= OnAndroidBack;
     gameObject.SetActive(false);
 }