void OnGUI()
        {
            if (!Init())
            {
                GUILayout.Space(8);
                GUILayout.Label("Completing import process...");
                return;
            }
            Connect();
            EditorGUIUtils.SetGUIStyles(_footerSize);

            if (Application.isPlaying)
            {
                GUILayout.Space(40);
                GUILayout.BeginHorizontal();
                GUILayout.Space(40);
                GUILayout.Label("DOTween Utility Panel\nis disabled while in Play Mode", EditorGUIUtils.wrapCenterLabelStyle, GUILayout.ExpandWidth(true));
                GUILayout.Space(40);
                GUILayout.EndHorizontal();
            }
            else
            {
                _scrollVal = GUILayout.BeginScrollView(_scrollVal);
                if (_src.modules.showPanel)
                {
                    if (DOTweenUtilityWindowModules.Draw(this, _src))
                    {
                        _setupRequired         = EditorUtils.DOTweenSetupRequired();
                        _src.modules.showPanel = false;
                        EditorUtility.SetDirty(_src);
                    }
                }
                else
                {
                    Rect areaRect = new Rect(0, 0, _headerSize.x, 30);
                    _selectedTab = GUI.Toolbar(areaRect, _selectedTab, _tabLabels);

                    switch (_selectedTab)
                    {
                    case 1:
                        float labelW = EditorGUIUtility.labelWidth;
                        EditorGUIUtility.labelWidth = 160;
                        DrawPreferencesGUI();
                        EditorGUIUtility.labelWidth = labelW;
                        break;

                    default:
                        DrawSetupGUI();
                        break;
                    }
                }
                GUILayout.EndScrollView();
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(_src);
            }
        }
示例#2
0
        public static void ApplyModulesSettings()
        {
            DOTweenSettings doTweenSettings = DOTweenUtilityWindow.GetDOTweenSettings();

            if (!((Object)doTweenSettings != (Object)null))
            {
                return;
            }
            DOTweenUtilityWindowModules.Refresh(doTweenSettings, true);
        }
示例#3
0
 private static void WaitForCompilation_Update()
 {
     if (!EditorApplication.isCompiling)
     {
         EditorApplication.update -= new EditorApplication.CallbackFunction(DOTweenUtilityWindowModules.WaitForCompilation_Update);
         DOTweenUtilityWindowModules._isWaitingForCompilation = false;
         DOTweenUtilityWindowModules.Refresh(DOTweenUtilityWindowModules._src, false);
     }
     DOTweenUtilityWindowModules._editor.Repaint();
 }
示例#4
0
 private static void WaitForCompilation()
 {
     if (!DOTweenUtilityWindowModules._isWaitingForCompilation)
     {
         DOTweenUtilityWindowModules._isWaitingForCompilation = true;
         EditorApplication.update += new EditorApplication.CallbackFunction(DOTweenUtilityWindowModules.WaitForCompilation_Update);
         DOTweenUtilityWindowModules.WaitForCompilation_Update();
     }
     EditorGUILayout.HelpBox("Waiting for Unity to finish the compilation process...", MessageType.Info);
 }
示例#5
0
        private static void Apply()
        {
            AssetDatabase.StartAssetEditing();
            bool flag1 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._audioModule, ref DOTweenUtilityWindowModules._src.modules.audioEnabled);
            bool flag2 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._physicsModule, ref DOTweenUtilityWindowModules._src.modules.physicsEnabled);
            bool flag3 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._physics2DModule, ref DOTweenUtilityWindowModules._src.modules.physics2DEnabled);
            bool flag4 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._spriteModule, ref DOTweenUtilityWindowModules._src.modules.spriteEnabled);
            bool flag5 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._uiModule, ref DOTweenUtilityWindowModules._src.modules.uiEnabled);
            bool flag6 = false;
            bool flag7 = false;

            if (EditorUtils.hasPro)
            {
                flag6 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._textMeshProModule, ref DOTweenUtilityWindowModules._src.modules.textMeshProEnabled);
                flag7 = DOTweenUtilityWindowModules.ToggleModule(DOTweenUtilityWindowModules._tk2DModule, ref DOTweenUtilityWindowModules._src.modules.tk2DEnabled);
            }
            AssetDatabase.StopAssetEditing();
            EditorUtility.SetDirty((Object)DOTweenUtilityWindowModules._src);
            if (flag1 | flag2 | flag3 | flag4 | flag5 | flag6 | flag7)
            {
                StringBuilder strb = new StringBuilder();
                strb.Append("<b>DOTween module files modified ► </b>");
                if (flag1)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.audioEnabled, "Audio");
                }
                if (flag2)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.physicsEnabled, "Physics");
                }
                if (flag3)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.physics2DEnabled, "Physics2D");
                }
                if (flag4)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.spriteEnabled, "Sprites");
                }
                if (flag5)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.uiEnabled, "UI");
                }
                if (flag6)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.textMeshProEnabled, "TextMesh Pro");
                }
                if (flag7)
                {
                    DOTweenUtilityWindowModules.Apply_AppendLog(strb, DOTweenUtilityWindowModules._src.modules.tk2DEnabled, "2D Toolkit");
                }
                strb.Remove(strb.Length - 3, 3);
                Debug.Log((object)strb.ToString());
            }
            ASMDEFManager.RefreshExistingASMDEFFiles();
        }
示例#6
0
 private void OnGUI()
 {
     if (!this.Init())
     {
         GUILayout.Space(8f);
         GUILayout.Label("Completing import process...");
     }
     else
     {
         this.Connect(false);
         EditorGUIUtils.SetGUIStyles(new Vector2?(this._footerSize));
         if (Application.isPlaying)
         {
             GUILayout.Space(40f);
             GUILayout.BeginHorizontal();
             GUILayout.Space(40f);
             GUILayout.Label("DOTween Utility Panel\nis disabled while in Play Mode", EditorGUIUtils.wrapCenterLabelStyle, new GUILayoutOption[1]
             {
                 GUILayout.ExpandWidth(true)
             });
             GUILayout.Space(40f);
             GUILayout.EndHorizontal();
         }
         else if (this._src.modules.showPanel)
         {
             if (DOTweenUtilityWindowModules.Draw((EditorWindow)this, this._src))
             {
                 this._setupRequired         = EditorUtils.DOTweenSetupRequired();
                 this._src.modules.showPanel = false;
                 EditorUtility.SetDirty((UnityEngine.Object) this._src);
             }
         }
         else
         {
             this._selectedTab = GUI.Toolbar(new Rect(0.0f, 0.0f, this._headerSize.x, 30f), this._selectedTab, this._tabLabels);
             if (this._selectedTab == 1)
             {
                 double labelWidth = (double)EditorGUIUtility.labelWidth;
                 EditorGUIUtility.labelWidth = 160f;
                 this.DrawPreferencesGUI();
                 EditorGUIUtility.labelWidth = (float)labelWidth;
             }
             else
             {
                 this.DrawSetupGUI();
             }
         }
         if (!GUI.changed)
         {
             return;
         }
         EditorUtility.SetDirty((UnityEngine.Object) this._src);
     }
 }
示例#7
0
 public static bool Draw(EditorWindow editor, DOTweenSettings src)
 {
     DOTweenUtilityWindowModules._editor = editor;
     DOTweenUtilityWindowModules._src    = src;
     if (!DOTweenUtilityWindowModules._refreshed)
     {
         DOTweenUtilityWindowModules.Refresh(DOTweenUtilityWindowModules._src, false);
     }
     GUILayout.Label("Add/Remove Modules", EditorGUIUtils.titleStyle, new GUILayoutOption[0]);
     GUILayout.BeginVertical();
     EditorGUI.BeginDisabledGroup(EditorApplication.isCompiling);
     GUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
     GUILayout.Label("Unity", EditorGUIUtils.boldLabelStyle, new GUILayoutOption[0]);
     DOTweenUtilityWindowModules._audioModule.enabled     = EditorGUILayout.Toggle("Audio", DOTweenUtilityWindowModules._audioModule.enabled, new GUILayoutOption[0]);
     DOTweenUtilityWindowModules._physicsModule.enabled   = EditorGUILayout.Toggle("Physics", DOTweenUtilityWindowModules._physicsModule.enabled, new GUILayoutOption[0]);
     DOTweenUtilityWindowModules._physics2DModule.enabled = EditorGUILayout.Toggle("Physics2D", DOTweenUtilityWindowModules._physics2DModule.enabled, new GUILayoutOption[0]);
     DOTweenUtilityWindowModules._spriteModule.enabled    = EditorGUILayout.Toggle("Sprites", DOTweenUtilityWindowModules._spriteModule.enabled, new GUILayoutOption[0]);
     DOTweenUtilityWindowModules._uiModule.enabled        = EditorGUILayout.Toggle("UI", DOTweenUtilityWindowModules._uiModule.enabled, new GUILayoutOption[0]);
     EditorGUILayout.EndVertical();
     if (EditorUtils.hasPro)
     {
         GUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
         GUILayout.Label("External Assets (Pro)", EditorGUIUtils.boldLabelStyle, new GUILayoutOption[0]);
         DOTweenUtilityWindowModules._textMeshProModule.enabled = EditorGUILayout.Toggle("TextMesh Pro", DOTweenUtilityWindowModules._textMeshProModule.enabled, new GUILayoutOption[0]);
         DOTweenUtilityWindowModules._tk2DModule.enabled        = EditorGUILayout.Toggle("2D Toolkit", DOTweenUtilityWindowModules._tk2DModule.enabled, new GUILayoutOption[0]);
         EditorGUILayout.EndVertical();
     }
     GUILayout.Space(2f);
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("Apply"))
     {
         DOTweenUtilityWindowModules.Apply();
         DOTweenUtilityWindowModules.Refresh(DOTweenUtilityWindowModules._src, false);
         return(true);
     }
     if (GUILayout.Button("Cancel"))
     {
         return(true);
     }
     GUILayout.EndHorizontal();
     EditorGUI.EndDisabledGroup();
     GUILayout.EndVertical();
     if (EditorApplication.isCompiling)
     {
         DOTweenUtilityWindowModules.WaitForCompilation();
     }
     return(false);
 }
示例#8
0
        private static bool ToggleModule(DOTweenUtilityWindowModules.ModuleInfo m, ref bool srcSetting)
        {
            if (!File.Exists(m.filePath))
            {
                return(false);
            }
            srcSetting = m.enabled;
            bool flag = false;

            DOTweenUtilityWindowModules._LinesToChange.Clear();
            string[] strArray = File.ReadAllLines(m.filePath);
            for (int index = 0; index < strArray.Length; ++index)
            {
                string str = strArray[index];
                if (str.EndsWith("MODULE_MARKER") && str.StartsWith("#if") && (m.enabled && str.Contains("false") || !m.enabled && str.Contains("true")))
                {
                    DOTweenUtilityWindowModules._LinesToChange.Add(index);
                }
            }
            if (DOTweenUtilityWindowModules._LinesToChange.Count > 0)
            {
                flag = true;
                using (StreamWriter streamWriter = new StreamWriter(m.filePath))
                {
                    for (int index = 0; index < strArray.Length; ++index)
                    {
                        string str = strArray[index];
                        if (DOTweenUtilityWindowModules._LinesToChange.Contains(index))
                        {
                            str = m.enabled ? str.Replace("false", "true") : str.Replace("true", "false");
                        }
                        streamWriter.WriteLine(str);
                    }
                }
                AssetDatabase.ImportAsset(EditorUtils.FullPathToADBPath(m.filePath), ImportAssetOptions.Default);
            }
            string marker = m.id + "_MARKER";

            for (int index = 0; index < DOTweenUtilityWindowModules._ModuleDependentFiles.Length; ++index)
            {
                if (DOTweenUtilityWindowModules.ToggleModuleInDependentFile(DOTweenUtilityWindowModules._ModuleDependentFiles[index], m.enabled, marker))
                {
                    flag = true;
                }
            }
            DOTweenUtilityWindowModules._LinesToChange.Clear();
            return(flag);
        }
示例#9
0
 private static void CheckAutoModuleSettings(bool applySettings, DOTweenUtilityWindowModules.ModuleInfo m, ref bool srcModuleEnabled)
 {
     if (m.enabled == srcModuleEnabled)
     {
         return;
     }
     if (applySettings)
     {
         m.enabled = srcModuleEnabled;
         DOTweenUtilityWindowModules.ToggleModule(m, ref srcModuleEnabled);
     }
     else
     {
         srcModuleEnabled = m.enabled;
         EditorUtility.SetDirty((Object)DOTweenUtilityWindowModules._src);
     }
 }
示例#10
0
 public static void Refresh(DOTweenSettings src, bool applySrcSettings = false)
 {
     DOTweenUtilityWindowModules._src       = src;
     DOTweenUtilityWindowModules._refreshed = true;
     AssetDatabase.StartAssetEditing();
     DOTweenUtilityWindowModules._audioModule.enabled       = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._audioModule);
     DOTweenUtilityWindowModules._physicsModule.enabled     = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._physicsModule);
     DOTweenUtilityWindowModules._physics2DModule.enabled   = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._physics2DModule);
     DOTweenUtilityWindowModules._spriteModule.enabled      = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._spriteModule);
     DOTweenUtilityWindowModules._uiModule.enabled          = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._uiModule);
     DOTweenUtilityWindowModules._textMeshProModule.enabled = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._textMeshProModule);
     DOTweenUtilityWindowModules._tk2DModule.enabled        = DOTweenUtilityWindowModules.ModuleIsEnabled(DOTweenUtilityWindowModules._tk2DModule);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._audioModule, ref src.modules.audioEnabled);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._physicsModule, ref src.modules.physicsEnabled);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._physics2DModule, ref src.modules.physics2DEnabled);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._spriteModule, ref src.modules.spriteEnabled);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._uiModule, ref src.modules.uiEnabled);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._textMeshProModule, ref src.modules.textMeshProEnabled);
     DOTweenUtilityWindowModules.CheckAutoModuleSettings(applySrcSettings, DOTweenUtilityWindowModules._tk2DModule, ref src.modules.tk2DEnabled);
     AssetDatabase.StopAssetEditing();
     EditorUtility.SetDirty((Object)DOTweenUtilityWindowModules._src);
 }
        // ===================================================================================
        // 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/");
            }
        }
示例#12
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/");
            }
        }
示例#13
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/");
            }
        }