mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
[unity] Fixed activating and deactivating asmdef files for 2D Toolkit.
This commit is contained in:
parent
dabe0456bc
commit
f45e13b40d
@ -150,11 +150,11 @@ namespace Spine.Unity.Editor {
|
|||||||
internal static void SetAsmdefFileActive (string filename, bool setActive) {
|
internal static void SetAsmdefFileActive (string filename, bool setActive) {
|
||||||
|
|
||||||
string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset";
|
string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset";
|
||||||
string extensionBeforeChange = setActive ? "txt" : "asmdef";
|
string extensionBeforeChange = setActive ? ".txt" : ".asmdef";
|
||||||
string[] guids = AssetDatabase.FindAssets(filename + typeSearchString);
|
string[] guids = AssetDatabase.FindAssets(filename + typeSearchString);
|
||||||
foreach (string guid in guids) {
|
foreach (string guid in guids) {
|
||||||
string currentPath = AssetDatabase.GUIDToAssetPath(guid);
|
string currentPath = AssetDatabase.GUIDToAssetPath(guid);
|
||||||
if (!System.IO.Path.HasExtension(extensionBeforeChange)) // asmdef is also found as t:TextAsset, so check
|
if (System.IO.Path.GetExtension(currentPath) != extensionBeforeChange) // asmdef is also found as t:TextAsset, so check
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt");
|
string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user