mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
Update TEngineEditor.cs
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user