コード例 #1
0
    public void OnClickEditButton()
    {
        if (!AppAction.isEditButtonDataMode)
        {
            AppAction.propertiesDialog     = (GameObject)Instantiate(buttonEditorPrefab, transform.parent);
            AppAction.isEditButtonDataMode = true;

            OkEditButton okButton = AppAction.propertiesDialog.transform.Find("OKButton").GetComponent <OkEditButton>();
            okButton.SetChangeMod();

            InputField inputName    = AppAction.propertiesDialog.transform.Find("InputButtonName").GetComponent <InputField>();
            InputField inputMessage = AppAction.propertiesDialog.transform.Find("InputButtonMessage").GetComponent <InputField>();
            InputField inputWidth   = AppAction.propertiesDialog.transform.Find("InputButtonWidth").GetComponent <InputField>();
            InputField inputHeight  = AppAction.propertiesDialog.transform.Find("InputButtonHeight").GetComponent <InputField>();

            string buttonName    = AppAction.selectedItem.GetComponent <ButtonData>().GetButtonName();
            string buttonMessage = AppAction.selectedItem.GetComponent <ButtonData>().GetButtonMessage();
            float  buttonWidth   = AppAction.selectedItem.GetComponent <ButtonData>().GetWidthCoef();
            float  buttonHeight  = AppAction.selectedItem.GetComponent <ButtonData>().GetHeightCoef();
            Debug.Log(buttonWidth + " x " + buttonHeight);

            inputName.text    = buttonName;
            inputMessage.text = buttonMessage;
            inputWidth.text   = buttonWidth.ToString();
            inputHeight.text  = buttonHeight.ToString();
        }
    }
コード例 #2
0
    // Update is called once per frame


    void CreateDialog()
    {
        GameObject editorCanvas = GameObject.FindGameObjectWithTag("EditorCanvas");

        AppAction.propertiesDialog = (GameObject)Instantiate(buttonEditorPrefab, editorCanvas.transform);
        OkEditButton okButton = AppAction.propertiesDialog.transform.Find("OKButton").GetComponent <OkEditButton>();

        okButton.SetCreateMod();
        Debug.Log("created dialog");
    }