FIxed the bug that properpty drawer does not work well on the version less than unity 6.1
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Misaki.ShaderGUI
|
||||
{
|
||||
private static readonly GUIContent[] _options = { new("Disabled"), new("Enabled") };
|
||||
|
||||
protected virtual void OnPropertyChange(MaterialProperty prop)
|
||||
protected virtual void OnPropertyChanged(MaterialProperty prop)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Misaki.ShaderGUI
|
||||
#if UNITY_6000_1_OR_NEWER
|
||||
return prop.propertyType == ShaderPropertyType.Float || prop.propertyType == ShaderPropertyType.Range || prop.propertyType == ShaderPropertyType.Int;
|
||||
#else
|
||||
return prop.type == MaterialProperty.PropType.Float || prop.type == MaterialProperty.PropType.Range || prop.type == MaterialProperty.PropType.Float;
|
||||
return prop.type == MaterialProperty.PropType.Float || prop.type == MaterialProperty.PropType.Range || prop.type == MaterialProperty.PropType.Int;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Misaki.ShaderGUI
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
prop.floatValue = value;
|
||||
OnPropertyChange(prop);
|
||||
OnPropertyChanged(prop);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -62,7 +62,7 @@ namespace Misaki.ShaderGUI
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
prop.intValue = value;
|
||||
OnPropertyChange(prop);
|
||||
OnPropertyChanged(prop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Misaki.ShaderGUI
|
||||
{
|
||||
private const string Keyword_Suffix = "_ON";
|
||||
|
||||
protected override void OnPropertyChange(MaterialProperty prop)
|
||||
protected override void OnPropertyChanged(MaterialProperty prop)
|
||||
{
|
||||
var keywordName = prop.name.ToUpper() + Keyword_Suffix;
|
||||
foreach (var target in prop.targets)
|
||||
@@ -109,7 +109,7 @@ namespace Misaki.ShaderGUI
|
||||
_passName = passName;
|
||||
}
|
||||
|
||||
protected override void OnPropertyChange(MaterialProperty prop)
|
||||
protected override void OnPropertyChanged(MaterialProperty prop)
|
||||
{
|
||||
foreach (var target in prop.targets)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user