整合SLSUtilities

This commit is contained in:
SoulliesOfficial
2026-01-17 11:35:49 -05:00
parent d94241f36c
commit 7ee2894a63
1338 changed files with 3051541 additions and 507034 deletions

View File

@@ -0,0 +1,27 @@
using UnityEditor;
using UnityEngine;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
using PackageSource = UnityEditor.PackageManager.PackageSource;
namespace LunaWolfStudiosEditor.ScriptableSheets.Shared
{
public static class PackageUtility
{
/// <summary>
/// Returns true if the provided Object is part of an immutable Package.
/// </summary>
public static bool IsAssetImmutable(Object asset)
{
return IsAssetImmutable(AssetDatabase.GetAssetPath(asset));
}
/// <summary>
/// Returns true if the provided asset path is part of an immutable Package.
/// </summary>
public static bool IsAssetImmutable(string assetPath)
{
var assetPackage = PackageInfo.FindForAssetPath(assetPath);
return assetPackage != null && assetPackage.source != PackageSource.Embedded && assetPackage.source != PackageSource.Local;
}
}
}