Update TEngineEditor.cs

This commit is contained in:
ALEXTANG
2022-05-25 23:20:52 +08:00
parent f603afec7e
commit 3ec86b0892

View File

@@ -91,31 +91,6 @@ namespace TEngine.Editor
assetPaths = AssetDatabase.GetDependencies(assetPaths);
AssetDatabase.ExportPackage(assetPaths, path, ExportPackageOptions.Interactive | ExportPackageOptions.Recurse | ExportPackageOptions.IncludeDependencies);
}
[MenuItem("Assets/Get Asset Path", priority = 3)]
static void GetAssetPath()
{
UnityEngine.Object selObj = Selection.activeObject;
if (selObj != null)
{
string assetPath = AssetDatabase.GetAssetPath(selObj);
int sindex = assetPath.IndexOf(AssetConfig.AssetRootPath);
int eindex = assetPath.LastIndexOf('.');
if (sindex >= 0 && eindex >= 0)
{
string resPath = assetPath.Substring(sindex + AssetConfig.AssetRootPath.Length + 1);
if (selObj is Sprite)
resPath += $"#{selObj.name}";
TLogger.LogInfoSuccessd($"Asset path is {resPath}");
EditorGUIUtility.systemCopyBuffer = resPath;
}
else
{
TLogger.LogError("This is not a Asset file!");
}
}
}
#endif
}
}