diff --git a/_DOTween.Assembly/DOTween.sln b/_DOTween.Assembly/DOTween.sln index 07d5337..5518894 100644 --- a/_DOTween.Assembly/DOTween.sln +++ b/_DOTween.Assembly/DOTween.sln @@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween_LooseScripts", "DOT EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Legacy_NoModules", "Legacy_NoModules", "{3945F2EC-EA44-45DF-82B5-33E978AE8345}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTweenUpgradeManager", "DOTweenUpgradeManager\DOTweenUpgradeManager.csproj", "{6BC7290B-999D-4688-959C-868306C1F52B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CompatibilityMode|Any CPU = CompatibilityMode|Any CPU @@ -93,6 +95,16 @@ Global {0B529A90-0B97-4840-BEB6-4A6700B46655}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release|Any CPU {0B529A90-0B97-4840-BEB6-4A6700B46655}.Release_NoRigidbody|Any CPU.ActiveCfg = Release|Any CPU {0B529A90-0B97-4840-BEB6-4A6700B46655}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.CompatibilityMode|Any CPU.ActiveCfg = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.CompatibilityMode|Any CPU.Build.0 = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Release_IncludeRigidbody|Any CPU.Build.0 = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Release_NoRigidbody|Any CPU.ActiveCfg = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Release_NoRigidbody|Any CPU.Build.0 = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BC7290B-999D-4688-959C-868306C1F52B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/_DOTween.Assembly/DOTweenEditor/DOTweenProcessors.cs b/_DOTween.Assembly/DOTweenEditor/DOTweenProcessors.cs index c641d8e..7e39792 100644 --- a/_DOTween.Assembly/DOTweenEditor/DOTweenProcessors.cs +++ b/_DOTween.Assembly/DOTweenEditor/DOTweenProcessors.cs @@ -53,7 +53,6 @@ namespace DG.DOTweenEditor static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { - Debug.Log("OnPostprocessAllAssets"); if (_setupDialogRequested) return; string[] dotweenEntries = System.Array.FindAll(importedAssets, name => name.Contains("DOTween") && !name.EndsWith(".meta") && !name.EndsWith(".jpg") && !name.EndsWith(".png")); @@ -73,14 +72,14 @@ namespace DG.DOTweenEditor _setupDialogRequested = true; EditorPrefs.SetString(Application.dataPath + DOTweenUtilityWindow.Id, Application.dataPath + DOTween.Version); if (EditorUtils.hasPro) EditorPrefs.SetString(Application.dataPath + DOTweenUtilityWindow.IdPro, Application.dataPath + EditorUtils.proVersion); - EditorUtility.DisplayDialog("DOTween", - differentCoreVersion - ? "New version of DOTween imported." + - "\n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to add/remove Modules." - : "New version of DOTween Pro imported." + - " \n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to add/remove external Modules (TextMesh Pro/2DToolkit/etc).", - "Ok" - ); +// EditorUtility.DisplayDialog("DOTween", +// differentCoreVersion +// ? "New version of DOTween imported." + +// "\n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to add/remove Modules." +// : "New version of DOTween Pro imported." + +// " \n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to add/remove external Modules (TextMesh Pro/2DToolkit/etc).", +// "Ok" +// ); DOTweenUtilityWindow.Open(); // Opening window after a postProcess doesn't work on Unity 3 so check that // string[] vs = Application.unityVersion.Split("."[0]); diff --git a/_DOTween.Assembly/DOTweenEditor/EditorUtils.cs b/_DOTween.Assembly/DOTweenEditor/EditorUtils.cs index 808fdf8..6ac6a48 100644 --- a/_DOTween.Assembly/DOTweenEditor/EditorUtils.cs +++ b/_DOTween.Assembly/DOTweenEditor/EditorUtils.cs @@ -80,22 +80,36 @@ namespace DG.DOTweenEditor } /// - /// Returns TRUE if addons setup is required (legacy: now it always returns TRUE). + /// Returns TRUE if setup is required /// public static bool DOTweenSetupRequired() { - return false; - // Legacy method + if (!Directory.Exists(dotweenDir)) return false; + return Directory.GetFiles(dotweenDir + "Editor", "DOTweenUpgradeManager.*").Length > 0; + + // Legacy methods // if (!Directory.Exists(dotweenDir)) return false; // Can happen if we were deleting DOTween // return Directory.GetFiles(dotweenDir, "*.addon").Length > 0 || hasPro && Directory.GetFiles(dotweenProDir, "*.addon").Length > 0; } + // Deletes DOTweenUpgradeManager files + public static void DeleteDOTweenUpgradeManagerFiles() + { + string adbDOTweenDir = FullPathToADBPath(dotweenDir); + AssetDatabase.StartAssetEditing(); + DeleteAssetsIfExist(new[] { + adbDOTweenDir + "Editor/DOTweenUpgradeManager.dll", + adbDOTweenDir + "Editor/DOTweenUpgradeManager.xml", + adbDOTweenDir + "Editor/DOTweenUpgradeManager.dll.mdb" + }); + AssetDatabase.StopAssetEditing(); + } + // Deletes the files used in older versions of DOTween where Modules still didn't exist public static void DeleteLegacyNoModulesDOTweenFiles() { string adbDOTweenDir = FullPathToADBPath(dotweenDir); AssetDatabase.StartAssetEditing(); - Debug.Log(adbDOTweenDir + "DOTween43.dll"); DeleteAssetsIfExist(new[] { adbDOTweenDir + "DOTween43.dll", adbDOTweenDir + "DOTween43.xml", diff --git a/_DOTween.Assembly/DOTweenEditor/UI/DOTweenUtilityWindow.cs b/_DOTween.Assembly/DOTweenEditor/UI/DOTweenUtilityWindow.cs index 70a17f2..3206f31 100644 --- a/_DOTween.Assembly/DOTweenEditor/UI/DOTweenUtilityWindow.cs +++ b/_DOTween.Assembly/DOTweenEditor/UI/DOTweenUtilityWindow.cs @@ -153,6 +153,7 @@ namespace DG.DOTweenEditor.UI DOTweenUtilityWindowModules.Refresh(); _isModulesMode = true; EditorUtils.DeleteLegacyNoModulesDOTweenFiles(); + EditorUtils.DeleteDOTweenUpgradeManagerFiles(); return; } GUILayout.FlexibleSpace(); diff --git a/_DOTween.Assembly/DOTweenUpgradeManager/Autorun.cs b/_DOTween.Assembly/DOTweenUpgradeManager/Autorun.cs new file mode 100644 index 0000000..5366a82 --- /dev/null +++ b/_DOTween.Assembly/DOTweenUpgradeManager/Autorun.cs @@ -0,0 +1,29 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/16 18:41 +// License Copyright (c) Daniele Giardini +// This work is subject to the terms at http://dotween.demigiant.com/license.php + +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEngine; + +namespace DG.DOTweenUpgradeManager +{ + /// + /// This class and its whole library are deleted the first time DOTween's setup is run after an upgrade (or after a new install) + /// + static class Autorun + { + [DidReloadScripts] + static void DidReloadScripts() + { + EditorUtility.DisplayDialog("DOTween", + "New version of DOTween imported: SETUP REQUIRED." + + "\n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to set it up and to add/remove Modules." + + "\n\nIMPORTANT: if you were upgrading from a DOTween version older than 1.2.000 you will see lots of errors." + + " Close and reopen your project, then open DOTween's Utility Panel and run the Setup to activate required Modules.", + "Ok" + ); + } + } +} \ No newline at end of file diff --git a/_DOTween.Assembly/DOTweenUpgradeManager/DOTweenUpgradeManager.csproj b/_DOTween.Assembly/DOTweenUpgradeManager/DOTweenUpgradeManager.csproj new file mode 100644 index 0000000..0a2ee14 --- /dev/null +++ b/_DOTween.Assembly/DOTweenUpgradeManager/DOTweenUpgradeManager.csproj @@ -0,0 +1,67 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {6BC7290B-999D-4688-959C-868306C1F52B} + Library + Properties + DG.DOTweenUpgradeManager + DOTweenUpgradeManager + v3.5 + 512 + Unity Subset v3.5 + + + true + full + false + ..\bin\Editor\ + DEBUG;TRACE + prompt + 4 + ..\bin\Editor\DOTweenUpgradeManager.XML + 1591 + + + pdbonly + true + ..\bin\Editor\ + TRACE + prompt + 4 + ..\bin\Editor\DOTweenUpgradeManager.XML + 1591 + + + OnOutputUpdated + + + + + C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEditor.dll + False + + + C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll + False + + + + + + + + + call $(SolutionDir)PostBuild_DOTween.bat $(SolutionDir) $(TargetDir) $(TargetFileName) $(TargetName) DOTween bin Editor + + + \ No newline at end of file diff --git a/_DOTween.Assembly/DOTweenUpgradeManager/Properties/AssemblyInfo.cs b/_DOTween.Assembly/DOTweenUpgradeManager/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6d06ebc --- /dev/null +++ b/_DOTween.Assembly/DOTweenUpgradeManager/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DOTweenUpgradeManager")] +[assembly: AssemblyDescription("Upgrade manager for DOTween")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Demigiant")] +[assembly: AssemblyProduct("DOTweenUpgradeManager")] +[assembly: AssemblyCopyright("Copyright © Daniele Giardini, Demigiant 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("807e068c-2a0e-4c81-a303-4b4fd3924511")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/_DOTween.Assembly/PostBuild_DOTween.bat b/_DOTween.Assembly/PostBuild_DOTween.bat index 0f33186..ec5a9b7 100644 --- a/_DOTween.Assembly/PostBuild_DOTween.bat +++ b/_DOTween.Assembly/PostBuild_DOTween.bat @@ -28,7 +28,7 @@ CD %2 echo ::: Deleting PDB files: %4.pdb DEL %4.pdb echo ::: PDB files deleted, PAUSE for 0.5 second -waitfor pdbsToBeDeletedHopefully /t 0.5 2>NUL || type nul>nul +waitfor pdbFilesToBeDeletedIHope /t 0.5 2>NUL || type nul>nul echo :::::: Starting export...