Files
AR-Menu/Library/PackageCache/com.needle.engine-exporter@8c046140a1d9/Common/Runtime/Utils/AssetUtils.cs
2025-11-30 08:35:03 +02:00

23 lines
465 B
C#

using UnityEditor;
using UnityEngine;
namespace Needle.Engine.Utils
{
public static class AssetUtils
{
public static bool IsGlbAsset(GameObject go, out string path)
{
#if UNITY_EDITOR
path = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(go);
if (path.EndsWith(".glb") || path.EndsWith(".gltf"))
{
return PrefabUtility.GetNearestPrefabInstanceRoot(go) == go;
}
return false;
#else
path = null;
return false;
#endif
}
}
}