예제 #1
0
    /// <summary>
    /// Shows the dialog to the user and asks for input.
    /// </summary>
    public void ShowDialog(ProvinceNameCallback callback)
    {
        // reset the name
        provinceNameField.text = "";
        this.callback          = callback;

        Show();
    }
예제 #2
0
    /// <summary>
    /// DO NOT CALL. This is called whenever the button is clicked.
    /// </summary>
    public void OnNameChosen()
    {
        if (callback == null)
        {
            return;
        }

        // make the callback, then set it to null
        callback(provinceNameField.text);
        callback = null;

        Hide();
    }