mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-06 15:24:57 +08:00
Added DOTweenUpgradeManager library
This commit is contained in:
parent
431cf32a39
commit
8601e64616
@ -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
|
||||
|
||||
@ -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]);
|
||||
|
||||
@ -80,22 +80,36 @@ namespace DG.DOTweenEditor
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns TRUE if addons setup is required (legacy: now it always returns TRUE).
|
||||
/// Returns TRUE if setup is required
|
||||
/// </summary>
|
||||
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",
|
||||
|
||||
@ -153,6 +153,7 @@ namespace DG.DOTweenEditor.UI
|
||||
DOTweenUtilityWindowModules.Refresh();
|
||||
_isModulesMode = true;
|
||||
EditorUtils.DeleteLegacyNoModulesDOTweenFiles();
|
||||
EditorUtils.DeleteDOTweenUpgradeManagerFiles();
|
||||
return;
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
29
_DOTween.Assembly/DOTweenUpgradeManager/Autorun.cs
Normal file
29
_DOTween.Assembly/DOTweenUpgradeManager/Autorun.cs
Normal file
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// This class and its whole library are deleted the first time DOTween's setup is run after an upgrade (or after a new install)
|
||||
/// </summary>
|
||||
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"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{6BC7290B-999D-4688-959C-868306C1F52B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DG.DOTweenUpgradeManager</RootNamespace>
|
||||
<AssemblyName>DOTweenUpgradeManager</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\Editor\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>..\bin\Editor\DOTweenUpgradeManager.XML</DocumentationFile>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\Editor\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>..\bin\Editor\DOTweenUpgradeManager.XML</DocumentationFile>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Autorun.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>call $(SolutionDir)PostBuild_DOTween.bat $(SolutionDir) $(TargetDir) $(TargetFileName) $(TargetName) DOTween bin Editor</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@ -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")]
|
||||
@ -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...
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user