[unity] Fixed another occurrence of compile errors in Unity 2017.3 when enabling TK2D define due to asmdef files. See #1280.

This commit is contained in:
Harald Csaszar 2019-02-26 16:55:03 +01:00
parent 15be5feeea
commit 8ca94c2da4

View File

@ -1852,12 +1852,12 @@ namespace Spine.Unity.Editor {
internal static void SetAsmdefFileActive(string filename, bool setActive) {
string typeSearchString = setActive ? " t:textasset" : " t:asmdef";
string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset";
string[] guids = AssetDatabase.FindAssets(filename + typeSearchString);
foreach (string guid in guids) {
string currentPath = AssetDatabase.GUIDToAssetPath(guid);
string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt");
if (System.IO.File.Exists(currentPath)) {
if (System.IO.File.Exists(currentPath) && !System.IO.File.Exists(targetPath)) {
System.IO.File.Copy(currentPath, targetPath);
System.IO.File.Copy(currentPath + ".meta", targetPath + ".meta");
}