Exemplo n.º 1
0
    private void OnGUI()
    {
        GUI.skin.label.richText     = true;
        GUI.skin.button.richText    = true;
        GUI.skin.box.richText       = true;
        GUI.skin.textArea.richText  = true;
        GUI.skin.textField.richText = true;
        GUI.skin.toggle.richText    = true;
        GUI.skin.window.richText    = true;

        //GUILayout.Label(PlatformType.GetName(this.Platform).SetSize(20).SetBold());
        GUILayout.Label(PlatformType.GetName(this.Platform));

        FieldInspectorTool.ShowObject(this);

        var type       = this.GetType();
        var fieldInfos = type.GetFields(BindingFlags.Public | BindingFlags.Instance);

        foreach (var fieldInfo in fieldInfos)
        {
            this.SaveCacheValue(fieldInfo);
        }

        if (GUITool.Button("生成", Color.green))
        {
            bfProductName = PlayerSettings.productName;
            if (!string.IsNullOrEmpty(productName.Trim()))
            {
                PlayerSettings.productName = productName.Trim();
            }
            try
            {
                this.Build();
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                PlayerSettings.productName = bfProductName;
            }
        }

        this.PlatformGUI();
    }