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); }
public void Close() { Delegate = null; KeyInputManager.shared.Deregister(); InputRegistry.shared.Deregister(this); GestureRecognizerCollection.shared.GetAndroidBackButtonGestureRecognizer().OnGesture -= OnAndroidBack; gameObject.SetActive(false); }