WuhuIslandTesting/Library/PackageCache/com.unity.scriptablebuildpipeline@1.21.5/Editor/Utilities/PlayerSettingsApi.cs
2025-01-07 02:06:59 +01:00

30 lines
786 B
C#

using UnityEngine;
namespace UnityEditor.Build.Pipeline.Utilities
{
static class PlayerSettingsApi
{
static SerializedObject m_Target;
#if UNITY_2020_1_OR_NEWER
static SerializedProperty m_NumberOfMipsStripped;
#endif
static PlayerSettingsApi()
{
var playerSettings = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/ProjectSettings.asset");
#if UNITY_2020_1_OR_NEWER
m_Target = new SerializedObject(playerSettings);
m_NumberOfMipsStripped = m_Target.FindProperty("numberOfMipsStripped");
#endif
}
#if UNITY_2020_1_OR_NEWER
internal static int GetNumberOfMipsStripped()
{
m_Target.Update();
return m_NumberOfMipsStripped.intValue;
}
#endif
}
}