コード例 #1
0
        private void DrawSetupGUI()
        {
            Rect position = new Rect(0.0f, 30f, this._headerSize.x, this._headerSize.y);

            GUI.DrawTexture(position, (Texture)this._headerImg, ScaleMode.StretchToFill, false);
            GUILayout.Space((float)((double)position.y + (double)this._headerSize.y + 2.0));
            GUILayout.Label(this._innerTitle, EditorGUIUtils.boldLabelStyle, new GUILayoutOption[0]);
            if (this._setupRequired)
            {
                GUI.backgroundColor = Color.red;
                GUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
                GUILayout.Label("DOTWEEN SETUP REQUIRED", EditorGUIUtils.setupLabelStyle, new GUILayoutOption[0]);
                GUILayout.EndVertical();
                GUI.backgroundColor = Color.white;
            }
            else
            {
                GUILayout.Space(8f);
            }
            GUI.color = Color.green;
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("<b>Setup DOTween...</b>\n(add/remove Modules)", EditorGUIUtils.btSetup, new GUILayoutOption[1]
            {
                GUILayout.Width(200f)
            }))
            {
                DOTweenUtilityWindowModules.ApplyModulesSettings();
                this._src.modules.showPanel = true;
                EditorUtility.SetDirty((UnityEngine.Object) this._src);
                EditorUtils.DeleteLegacyNoModulesDOTweenFiles();
                DOTweenDefines.RemoveAllLegacyDefines();
                EditorUtils.DeleteDOTweenUpgradeManagerFiles();
            }
            else
            {
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                GUI.color = Color.white;
                GUILayout.Space(4f);
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUI.color = ASMDEFManager.hasModulesASMDEF ? Color.yellow : Color.cyan;
                if (GUILayout.Button(ASMDEFManager.hasModulesASMDEF ? "Remove ASMDEF..." : "Create ASMDEF...", EditorGUIUtils.btSetup, new GUILayoutOption[1]
                {
                    GUILayout.Width(200f)
                }))
                {
                    if (ASMDEFManager.hasModulesASMDEF)
                    {
                        if (EditorUtility.DisplayDialog("Remove ASMDEF", string.Format("This will remove the \"DOTween/Modules/DOTween.Modules.asmdef\" and \"DOTweenPro/DOTweenPro.Scripts.asmdef\" (if you have DOTween Pro) files."), "Ok", "Cancel"))
                        {
                            ASMDEFManager.RemoveAllASMDEF();
                        }
                    }
                    else if (EditorUtility.DisplayDialog("Create ASMDEF", string.Format("This will create the \"DOTween/Modules/DOTween.Modules.asmdef\" and \"DOTweenPro/DOTweenPro.Scripts.asmdef\" (if you have DOTween Pro) files."), "Ok", "Cancel"))
                    {
                        ASMDEFManager.CreateAllASMDEF();
                    }
                }
                GUI.color = Color.white;
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                GUILayout.Space(8f);
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Website", EditorGUIUtils.btBigStyle, new GUILayoutOption[1]
                {
                    GUILayout.Width(DOTweenUtilityWindow._HalfBtSize)
                }))
                {
                    Application.OpenURL("http://dotween.demigiant.com/index.php");
                }
                if (GUILayout.Button("Get Started", EditorGUIUtils.btBigStyle, new GUILayoutOption[1]
                {
                    GUILayout.Width(DOTweenUtilityWindow._HalfBtSize)
                }))
                {
                    Application.OpenURL("http://dotween.demigiant.com/getstarted.php");
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Documentation", EditorGUIUtils.btBigStyle, new GUILayoutOption[1]
                {
                    GUILayout.Width(DOTweenUtilityWindow._HalfBtSize)
                }))
                {
                    Application.OpenURL("http://dotween.demigiant.com/documentation.php");
                }
                if (GUILayout.Button("Support", EditorGUIUtils.btBigStyle, new GUILayoutOption[1]
                {
                    GUILayout.Width(DOTweenUtilityWindow._HalfBtSize)
                }))
                {
                    Application.OpenURL("http://dotween.demigiant.com/support.php");
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Changelog", EditorGUIUtils.btBigStyle, new GUILayoutOption[1]
                {
                    GUILayout.Width(DOTweenUtilityWindow._HalfBtSize)
                }))
                {
                    Application.OpenURL("http://dotween.demigiant.com/download.php");
                }
                if (GUILayout.Button("Check Updates", EditorGUIUtils.btBigStyle, new GUILayoutOption[1]
                {
                    GUILayout.Width(DOTweenUtilityWindow._HalfBtSize)
                }))
                {
                    Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version);
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(14f);
                if (!GUILayout.Button((Texture)this._footerImg, EditorGUIUtils.btImgStyle, new GUILayoutOption[0]))
                {
                    return;
                }
                Application.OpenURL("http://www.demigiant.com/");
            }
        }
コード例 #2
0
        // ===================================================================================
        // GUI METHODS -----------------------------------------------------------------------

        void DrawSetupGUI()
        {
            Rect areaRect = new Rect(0, 30, _headerSize.x, _headerSize.y);

            GUI.DrawTexture(areaRect, _headerImg, ScaleMode.StretchToFill, false);
            GUILayout.Space(areaRect.y + _headerSize.y + 2);
            GUILayout.Label(_innerTitle, TweenManager.isDebugBuild ? EditorGUIUtils.redLabelStyle : EditorGUIUtils.boldLabelStyle);

            if (_setupRequired)
            {
                GUI.backgroundColor = Color.red;
                GUILayout.BeginVertical(GUI.skin.box);
                GUILayout.Label("DOTWEEN SETUP REQUIRED", EditorGUIUtils.setupLabelStyle);
                GUILayout.EndVertical();
                GUI.backgroundColor = Color.white;
            }
            else
            {
                GUILayout.Space(8);
            }
            GUI.color = Color.green;
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("<b>Setup DOTween...</b>\n(add/remove Modules)", EditorGUIUtils.btSetup, GUILayout.Width(200)))
            {
//                DOTweenDefines.Setup();
//                _setupRequired = EditorUtils.DOTweenSetupRequired();
                DOTweenUtilityWindowModules.ApplyModulesSettings();
                _src.modules.showPanel = true;
                EditorUtility.SetDirty(_src);
                EditorUtils.DeleteLegacyNoModulesDOTweenFiles();
                DOTweenDefines.RemoveAllLegacyDefines();
                EditorUtils.DeleteDOTweenUpgradeManagerFiles();
                return;
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUI.color = Color.white;
            GUILayout.Space(4);

            // ASMDEF
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUI.color = ASMDEFManager.hasModulesASMDEF ? Color.yellow : Color.cyan;
            if (GUILayout.Button(ASMDEFManager.hasModulesASMDEF ? "Remove ASMDEF..." : "Create ASMDEF...", EditorGUIUtils.btSetup, GUILayout.Width(200)))
            {
                if (ASMDEFManager.hasModulesASMDEF)
                {
                    if (EditorUtility.DisplayDialog("Remove ASMDEF",
                                                    string.Format("This will remove the \"DOTween/Modules/DOTween.Modules.asmdef\" file" +
                                                                  " (and if you have DOTween Pro also the \"DOTweenPro/DOTweenPro.Scripts.asmdef\"" +
                                                                  " and \"DOTweenPro/Editor/DOTweenPro.EditorScripts.asmdef\" files)"),
                                                    "Ok", "Cancel"
                                                    ))
                    {
                        ASMDEFManager.RemoveAllASMDEF();
                    }
                }
                else
                {
                    if (EditorUtility.DisplayDialog("Create ASMDEF",
                                                    string.Format("This will create the \"DOTween/Modules/DOTween.Modules.asmdef\" file" +
                                                                  " (and if you have DOTween Pro also the \"DOTweenPro/DOTweenPro.Scripts.asmdef\"" +
                                                                  " and \"DOTweenPro/Editor/DOTweenPro.EditorScripts.asmdef\" files)"),
                                                    "Ok", "Cancel"
                                                    ))
                    {
                        ASMDEFManager.CreateAllASMDEF();
                    }
                }
            }
            GUI.color = Color.white;
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Label(
                "ASMDEFs are useful if you need to reference the extra DOTween modules API (like [<i>UIelement</i>].DOColor)" +
                " from other ASMDEFs/Libraries instead of loose scripts," +
                " but remember to have those <b>ASMDEFs/Libraries reference DOTween ones</b>.",
                EditorGUIUtils.wordWrapRichTextLabelStyle
                );
            GUILayout.Space(3);

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Website", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/index.php");
            }
            if (GUILayout.Button("Get Started", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/getstarted.php");
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Documentation", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/documentation.php");
            }
            if (GUILayout.Button("Support", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/support.php");
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Changelog", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/download.php");
            }
            if (GUILayout.Button("Check Updates", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(4);
            if (GUILayout.Button(_footerImg, EditorGUIUtils.btImgStyle))
            {
                Application.OpenURL("http://www.demigiant.com/");
            }
        }
コード例 #3
0
        // ===================================================================================
        // GUI METHODS -----------------------------------------------------------------------

        void DrawSetupGUI()
        {
            Rect areaRect = new Rect(0, 30, _headerSize.x, _headerSize.y);

            GUI.DrawTexture(areaRect, _headerImg, ScaleMode.StretchToFill, false);
            GUILayout.Space(areaRect.y + _headerSize.y + 2);
            GUILayout.Label(_innerTitle, TweenManager.isDebugBuild ? EditorGUIUtils.redLabelStyle : EditorGUIUtils.boldLabelStyle);

            if (_setupRequired)
            {
                GUI.backgroundColor = Color.red;
                GUILayout.BeginVertical(GUI.skin.box);
                GUILayout.Label("DOTWEEN SETUP REQUIRED", EditorGUIUtils.setupLabelStyle);
                GUILayout.EndVertical();
                GUI.backgroundColor = Color.white;
            }
            else
            {
                GUILayout.Space(8);
            }
            GUI.color = Color.green;
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("<b>Setup DOTween...</b>\n(add/remove Modules)", EditorGUIUtils.btSetup))
            {
//                DOTweenDefines.Setup();
//                _setupRequired = EditorUtils.DOTweenSetupRequired();
                DOTweenUtilityWindowModules.ApplyModulesSettings();
                _src.modules.showPanel = true;
                EditorUtility.SetDirty(_src);
                EditorUtils.DeleteLegacyNoModulesDOTweenFiles();
                DOTweenDefines.RemoveAllLegacyDefines();
                EditorUtils.DeleteDOTweenUpgradeManagerFiles();
                return;
            }
            GUILayout.FlexibleSpace();
            GUI.color = Color.white;
            GUILayout.EndHorizontal();
            GUILayout.Space(8);

//            EditorGUILayout.HelpBox(
//                "NOTE: if you get \"Requested build target group (N) doesn't exist\" or [CS0618] errors during the setup don't worry: it's ok and allows the setup to work on all possible Unity versions",
//                MessageType.Info
//            );

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Website", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/index.php");
            }
            if (GUILayout.Button("Get Started", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/getstarted.php");
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Documentation", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/documentation.php");
            }
            if (GUILayout.Button("Support", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/support.php");
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Changelog", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/download.php");
            }
            if (GUILayout.Button("Check Updates", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize)))
            {
                Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(14);
            if (GUILayout.Button(_footerImg, EditorGUIUtils.btImgStyle))
            {
                Application.OpenURL("http://www.demigiant.com/");
            }
        }