public override void Execute()
        {
            if (mPackageVersion.Readme.content.Length < 2)
            {
                GetConfig <PackageKit>()
                .GetUtility <IEditorDialogUtility>().ShowErrorMsg("请输入版本修改说明");
                return;
            }

            if (!IsVersionValide(mPackageVersion.Version))
            {
                GetConfig <PackageKit>()
                .GetUtility <IEditorDialogUtility>().ShowErrorMsg("请输入正确的版本号 格式:vX.Y.Z");
                return;
            }

            mPackageVersion.DocUrl = "http://lianxiegame.com";

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

            mPackageVersion.Save();

            AssetDatabase.Refresh();

            RenderEndCommandExecuter.PushCommand(() => { PublishPackage(mPackageVersion, false); });
        }
Example #2
0
        private void DrawInit()
        {
            if (mHasConfigFile)
            {
                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.Label("发布说明:", GUILayout.Width(150));
            mReleaseNote = GUILayout.TextArea(mReleaseNote, GUILayout.Width(250), GUILayout.Height(300));

            User.Username = EditorGUIUtils.GUILabelAndTextField("username:"******"password:"******"发布"))
            {
                User.Save();

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

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

                mPackageVersion.Version = mVersionText;
                mPackageVersion.Readme  = new ReleaseItem(mVersionText, mReleaseNote, SystemInfo.deviceName,
                                                          DateTime.Now.ToString("yyyy-MM-dd"));


                mPackageVersion.Save();

                AssetDatabase.Refresh();

                GotoPacking();
            }
        }
Example #3
0
        private void DrawInit()
        {
            if (mHasConfigFile)
            {
                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));

            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.Token.Value = string.Empty;
                    User.Save();
                }
            }

            if (User.Token.Value.IsNotNullAndEmpty() && GUILayout.Button("发布"))
            {
                User.Save();

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

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

                mPackageVersion.Version = mVersionText;
                mPackageVersion.Readme  = new ReleaseItem(mVersionText, mReleaseNote, SystemInfo.deviceName,
                                                          DateTime.Now.ToString("yyyy-MM-dd"));


                mPackageVersion.Save();

                AssetDatabase.Refresh();

                GotoPacking();
            }
        }
Example #4
0
        private void DrawInit()
        {
            if (mHasConfigFile)
            {
                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.Label("发布说明:", GUILayout.Width(150));
            mReleaseNote = GUILayout.TextArea(mReleaseNote, GUILayout.Width(250), GUILayout.Height(300));

            if (!User.Logined)
            {
                User.Username.Value = EditorGUIUtils.GUILabelAndTextField("username:"******"password:"******"登录"))
                {
                    Observable.FromCoroutine(_ => LoginAction.DoLogin(User.Username.Value, User.Password.Value, () =>
                    {
                        Debug.Log("True");
                        User.Logined = true;
                    })).Subscribe();
                }

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

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

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

            if (User.Logined && GUILayout.Button("发布"))
            {
                User.Save();

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

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

                mPackageVersion.Version = mVersionText;
                mPackageVersion.Readme  = new ReleaseItem(mVersionText, mReleaseNote, SystemInfo.deviceName,
                                                          DateTime.Now.ToString("yyyy-MM-dd"));


                mPackageVersion.Save();

                AssetDatabase.Refresh();

                GotoPacking();
            }
        }