Пример #1
0
        public override void OnGUI()
        {
            base.OnGUI();


            mRootLayout.OnGUI();

            if (GUIHelpers.DoToolbarEx("User Info"))
            {
                GUILayout.BeginVertical("box");

                if (User.Token.Value.IsNullOrEmpty())
                {
                    User.Username.Value = EditorGUIUtils.GUILabelAndTextField("username:"******"password:"******"登录"))
                    {
                        GetTokenAction.DoGetToken(User.Username.Value, User.Password.Value, token =>
                        {
                            User.Token.Value = token;
                            User.Save();
                        });
                    }

                    if (!inRegisterView && GUILayout.Button("注册"))
                    {
                        inRegisterView = true;
                    }

                    if (inRegisterView)
                    {
                        if (GUILayout.Button("注册"))
                        {
                        }

                        if (GUILayout.Button("返回注册"))
                        {
                            inRegisterView = false;
                        }
                    }
                }
                else
                {
                    if (GUILayout.Button("注销"))
                    {
                        User.Clear();
                    }
                }

                GUILayout.EndVertical();
            }
        }
Пример #2
0
        void OnGUI()
        {
            CurConfigData.Namespace = EditorGUIUtils.GUILabelAndTextField("Namespace", CurConfigData.Namespace);

                        #if NONE_LUA_SUPPORT
            CurConfigData.UIScriptDir = EditorGUIUtils.GUILabelAndTextField("UI Script Generate Dir", CurConfigData.UIScriptDir);
            CurConfigData.UIPrefabDir = EditorGUIUtils.GUILabelAndTextField("UI Prefab Dir", CurConfigData.UIPrefabDir);
                        #endif

            CurConfigData.ResLoaderSupportIndex = EditorGUIUtils.GUILabelAndPopup("AB Support",
                                                                                  CurConfigData.ResLoaderSupportIndex, FrameworkConfigData.RES_LOADER_SUPPORT_TEXTS);
            CurConfigData.LuaSupportIndex = EditorGUIUtils.GUILabelAndPopup("Lua Support", CurConfigData.LuaSupportIndex,
                                                                            FrameworkConfigData.LUA_SUPPORT_TEXTS);
            CurConfigData.CocosSupportIndex = EditorGUIUtils.GUILabelAndPopup("Cocos Support", CurConfigData.CocosSupportIndex,
                                                                              FrameworkConfigData.COCOS_SUPPORT_TEXTS);
            if (GUILayout.Button("Apply"))
            {
                CurConfigData.Save();
                MicroEditor.ApplyAllPlatform();
            }
        }
Пример #3
0
        private void DrawInit()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("当前版本号", GUILayout.Width(100));
            GUILayout.Label(mPackageVersion.Version, GUILayout.Width(100));
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            GUILayout.Label("发布版本号", GUILayout.Width(100));
            mVersionText = GUILayout.TextField(mVersionText, GUILayout.Width(100));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("类型", GUILayout.Width(100));

            mPackageVersion.Type = (PackageType)EditorGUILayout.EnumPopup(mPackageVersion.Type);

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("权限", GUILayout.Width(100));

            mPackageVersion.AccessRight = (PackageAccessRight)EditorGUILayout.EnumPopup(mPackageVersion.AccessRight);
            GUILayout.EndHorizontal();

            GUILayout.Label("发布说明:", GUILayout.Width(150));
            mReleaseNote = GUILayout.TextArea(mReleaseNote, GUILayout.Width(250), GUILayout.Height(300));

            GUILayout.BeginHorizontal();
            GUILayout.Label("文档地址:", GUILayout.Width(52));
            mPackageVersion.DocUrl = GUILayout.TextField(mPackageVersion.DocUrl, GUILayout.Width(150));
            if (GUILayout.Button("Paste"))
            {
                mPackageVersion.DocUrl = GUIUtility.systemCopyBuffer;
            }
            GUILayout.EndHorizontal();

            if (User.Token.Value.IsNullOrEmpty())
            {
                User.Username.Value = EditorGUIUtils.GUILabelAndTextField("username:"******"password:"******"登录"))
                {
                    GetTokenAction.DoGetToken(User.Username.Value, User.Password.Value, token =>
                    {
                        User.Token.Value = token;
                        User.Save();
                    });
                }

                if (!inRegisterView && GUILayout.Button("注册"))
                {
                    inRegisterView = true;
                }

                if (inRegisterView)
                {
                    if (GUILayout.Button("注册"))
                    {
                    }

                    if (GUILayout.Button("返回注册"))
                    {
                        inRegisterView = false;
                    }
                }
            }
            else
            {
                if (GUILayout.Button("注销"))
                {
                    User.Clear();
                }
            }

            if (User.Token.Value.IsNotNullAndEmpty())
            {
                var clicked     = false;
                var deleteLocal = false;

                if (GUILayout.Button("发布"))
                {
                    clicked = true;
                }

                if (GUILayout.Button("发布并删除本地"))
                {
                    clicked     = true;
                    deleteLocal = true;
                }

                if (clicked)
                {
                    User.Save();

                    if (mReleaseNote.Length < 2)
                    {
                        ShowErrorMsg("请输入版本修改说明");
                        return;
                    }

                    if (!IsVersionValide(mVersionText))
                    {
                        ShowErrorMsg("请输入正确的版本号");
                        return;
                    }

                    mPackageVersion.Version = mVersionText;
                    mPackageVersion.Readme  = new ReleaseItem(mVersionText, mReleaseNote, User.Username.Value,
                                                              DateTime.Now);

                    mPackageVersion.Save();

                    AssetDatabase.Refresh();

                    noticeMessage = "插件导出中,请稍后...";

                    Observable.NextFrame().Subscribe(_ =>
                    {
                        noticeMessage  = "插件上传中,请稍后...";
                        mUploadResult  = null;
                        mGenerateState = STATE_GENERATE_UPLOADING;
                        UploadPackage.DoUpload(mPackageVersion, () =>
                        {
                            if (deleteLocal)
                            {
                                Directory.Delete(mPackageVersion.InstallPath, true);
                                AssetDatabase.Refresh();
                            }

                            mUploadResult = "上传成功";
                            GotoComplete();
                        });
                    });
                }
            }
        }