Files
ichni_Official/Packages/NB_FX/XuanXuanRenderUtility/Editor/NBCompatEditorUtility.cs
SoulliesOfficial 40fa80cd70 NB_FX
2026-07-17 17:46:16 -04:00

32 lines
783 B
C#

using UnityEditor;
using UnityEngine.Rendering;
namespace NBShaderEditor
{
public static class ShaderGUIUnityCompat
{
public static ShaderPropertyType GetPropertyType(MaterialProperty property)
{
#if UNITY_6000_1_OR_NEWER
return property.propertyType;
#else
#pragma warning disable 0618
return (ShaderPropertyType)property.type;
#pragma warning restore 0618
#endif
}
public static bool HasHdrFlag(MaterialProperty property)
{
#if UNITY_6000_1_OR_NEWER
return (property.propertyFlags & ShaderPropertyFlags.HDR) != 0;
#else
#pragma warning disable 0618
return (((ShaderPropertyFlags)property.flags) & ShaderPropertyFlags.HDR) != 0;
#pragma warning restore 0618
#endif
}
}
}