@@ -171,7 +171,7 @@ public SubDrawer(string group)
171171 protected virtual float GetVisibleHeight ( MaterialProperty prop )
172172 {
173173 var height = MaterialEditor . GetDefaultPropertyHeight ( prop ) ;
174- return prop . type == MaterialProperty . PropType . Vector ? EditorGUIUtility . singleLineHeight : height ;
174+ return prop . GetPropertyType ( ) == ShaderPropertyType . Vector ? EditorGUIUtility . singleLineHeight : height ;
175175 }
176176
177177 public virtual void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData )
@@ -194,7 +194,7 @@ public override void OnGUI(Rect position, MaterialProperty prop, GUIContent labe
194194 }
195195 else
196196 {
197- Debug . LogWarning ( "LWGUI: Property:'" + prop . name + "' Type:'" + prop . type + "' mismatch!" ) ;
197+ Debug . LogWarning ( "LWGUI: Property:'" + prop . name + "' Type:'" + prop . GetPropertyType ( ) + "' mismatch!" ) ;
198198 editor . DefaultShaderProperty ( position , prop , label . text ) ;
199199 }
200200 }
@@ -207,7 +207,7 @@ public override float GetPropertyHeight(MaterialProperty prop, string label, Mat
207207 // Draws a custom style property
208208 public virtual void DrawProp ( Rect position , MaterialProperty prop , GUIContent label , MaterialEditor editor )
209209 {
210- RevertableHelper . FixGUIWidthMismatch ( prop . type , editor ) ;
210+ RevertableHelper . FixGUIWidthMismatch ( prop . GetPropertyType ( ) , editor ) ;
211211 editor . DefaultShaderPropertyInternal ( position , prop , label ) ;
212212 }
213213 }
@@ -244,7 +244,7 @@ public SubToggleDrawer(string group, string keyWord, string presetFileName)
244244
245245 protected override bool IsMatchPropType ( MaterialProperty property )
246246 {
247- return property . type is MaterialProperty . PropType . Float ;
247+ return property . GetPropertyType ( ) is ShaderPropertyType . Float ;
248248 }
249249
250250 public override void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData )
@@ -307,11 +307,11 @@ public SubPowerSliderDrawer(string group, float power)
307307 this . _power = Mathf . Clamp ( power , 0 , float . MaxValue ) ;
308308 }
309309
310- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Range ; }
310+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Range ; }
311311
312312 public override void DrawProp ( Rect position , MaterialProperty prop , GUIContent label , MaterialEditor editor )
313313 {
314- RevertableHelper . FixGUIWidthMismatch ( prop . type , editor ) ;
314+ RevertableHelper . FixGUIWidthMismatch ( prop . GetPropertyType ( ) , editor ) ;
315315 EditorGUI . showMixedValue = prop . hasMixedValue ;
316316 var rect = position ;
317317 ReflectionHelper . DoPowerRangeProperty ( rect , prop , label , _power ) ;
@@ -332,13 +332,13 @@ public SubIntRangeDrawer(string group)
332332 this . group = group ;
333333 }
334334
335- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Range ; }
335+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Range ; }
336336
337337 public override void DrawProp ( Rect position , MaterialProperty prop , GUIContent label , MaterialEditor editor )
338338 {
339- RevertableHelper . FixGUIWidthMismatch ( prop . type , editor ) ;
339+ RevertableHelper . FixGUIWidthMismatch ( prop . GetPropertyType ( ) , editor ) ;
340340
341- if ( prop . type != MaterialProperty . PropType . Range )
341+ if ( prop . GetPropertyType ( ) != ShaderPropertyType . Range )
342342 {
343343 EditorGUI . LabelField ( position , "IntRange used on a non-range property: " + prop . name , EditorStyles . helpBox ) ;
344344 }
@@ -382,7 +382,7 @@ public MinMaxSliderDrawer(string group, string minPropName, string maxPropName)
382382 this . _maxPropName = maxPropName ;
383383 }
384384
385- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Range ; }
385+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Range ; }
386386
387387 public override void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData )
388388 {
@@ -553,7 +553,7 @@ protected void Init(string group, string[] names, string[] keyWords, float[] val
553553 this . _values = values ;
554554 }
555555
556- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type is MaterialProperty . PropType . Float ; }
556+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) is ShaderPropertyType . Float ; }
557557
558558 protected virtual string GetKeywordName ( string propName , string name ) { return ( name ) . Replace ( ' ' , '_' ) . ToUpperInvariant ( ) ; }
559559
@@ -732,7 +732,7 @@ public static void ApplyPreset(string presetFileName, MaterialProperty prop)
732732 }
733733 }
734734
735- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Float ; }
735+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Float ; }
736736
737737 public override void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData )
738738 {
@@ -878,7 +878,7 @@ public BitMaskDrawer(string group, List<string> bitDescriptions)
878878 totalButtonWidth = buttonWidths . Sum ( ) ;
879879 }
880880
881- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Int ; }
881+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Int ; }
882882
883883 protected override float GetVisibleHeight ( MaterialProperty prop ) { return maxHeight ; }
884884
@@ -949,7 +949,7 @@ public LwguiRampAtlas rampAtlasSO
949949 if ( ! _rampAtlasSO )
950950 {
951951 var rampAtlasProp = metaDatas . GetProperty ( rampAtlasPropName ) ;
952- if ( rampAtlasProp != null && rampAtlasProp . type == MaterialProperty . PropType . Texture )
952+ if ( rampAtlasProp != null && rampAtlasProp . GetPropertyType ( ) == ShaderPropertyType . Texture )
953953 {
954954 _rampAtlasSO = LwguiRampAtlas . LoadRampAtlasSO ( rampAtlasProp . textureValue ) ;
955955 }
@@ -995,7 +995,7 @@ public RampAtlasIndexerDrawer(string group, string rampAtlasPropName, string def
995995 }
996996 }
997997
998- protected override bool IsMatchPropType ( MaterialProperty property ) => property . type is MaterialProperty . PropType . Float or MaterialProperty . PropType . Int ;
998+ protected override bool IsMatchPropType ( MaterialProperty property ) => property . GetPropertyType ( ) is ShaderPropertyType . Float or ShaderPropertyType . Int ;
999999
10001000 protected override void OnRampPropUpdate ( Rect position , MaterialProperty prop , GUIContent label , MaterialEditor editor )
10011001 {
@@ -1118,7 +1118,7 @@ protected override void DrawPreviewTextureOverride(Rect previewRect, MaterialPro
11181118 public override void DrawProp ( Rect position , MaterialProperty prop , GUIContent label , MaterialEditor editor )
11191119 {
11201120 var rampAtlasProp = metaDatas . GetProperty ( rampAtlasPropName ) ;
1121- if ( rampAtlasProp == null || rampAtlasProp . type != MaterialProperty . PropType . Texture )
1121+ if ( rampAtlasProp == null || rampAtlasProp . GetPropertyType ( ) != ShaderPropertyType . Texture )
11221122 {
11231123 Helper . DrawShaderPropertyWithErrorLabel ( position , prop , label , editor , "Invalid rampAtlasPropName" ) ;
11241124 Debug . LogError ( $ "LWGUI: Property { prop . name } has invalid rampAtlasPropName: { rampAtlasPropName } ") ;
@@ -1182,7 +1182,7 @@ public TexDrawer(string group, string extraPropName)
11821182
11831183 protected override float GetVisibleHeight ( MaterialProperty prop ) { return EditorGUIUtility . singleLineHeight ; }
11841184
1185- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Texture ; }
1185+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Texture ; }
11861186
11871187 public override void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData )
11881188 {
@@ -1196,7 +1196,7 @@ public override void GetDefaultValueDescription(Shader inShader, MaterialPropert
11961196 if ( defaultExtraProp != null )
11971197 {
11981198 var text = string . Empty ;
1199- if ( defaultExtraProp . type == MaterialProperty . PropType . Vector )
1199+ if ( defaultExtraProp . GetPropertyType ( ) == ShaderPropertyType . Vector )
12001200 text = ChannelDrawer . GetChannelName ( defaultExtraProp ) ;
12011201 else
12021202 text = RevertableHelper . GetPropertyDefaultValueText ( defaultExtraProp ) ;
@@ -1225,7 +1225,7 @@ public override void DrawProp(Rect position, MaterialProperty prop, GUIContent l
12251225 var extraRect = MaterialEditor . GetRightAlignedFieldRect ( rect ) ;
12261226 extraRect . height = rect . height ;
12271227
1228- if ( extraProp . type == MaterialProperty . PropType . Vector )
1228+ if ( extraProp . GetPropertyType ( ) == ShaderPropertyType . Vector )
12291229 _channelDrawer . OnGUI ( extraRect , extraProp , GUIContent . none , editor ) ;
12301230 else
12311231 editor . ShaderProperty ( extraRect , extraProp , GUIContent . none ) ;
@@ -1321,7 +1321,7 @@ public RampDrawer(string group, string defaultFileName, string rootPath, string
13211321 }
13221322 }
13231323
1324- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Texture ; }
1324+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Texture ; }
13251325
13261326 protected virtual void OnRampPropUpdate ( Rect position , MaterialProperty prop , GUIContent label , MaterialEditor editor ) { }
13271327
@@ -1580,7 +1580,7 @@ public RampAtlasDrawer(string group, string defaultFileName, string rootPath, st
15801580 this . defaultAtlasHeight = ( int ) Mathf . Max ( 2 , defaultHeight ) ;
15811581 }
15821582
1583- protected override bool IsMatchPropType ( MaterialProperty property ) => property . type == MaterialProperty . PropType . Texture ;
1583+ protected override bool IsMatchPropType ( MaterialProperty property ) => property . GetPropertyType ( ) == ShaderPropertyType . Texture ;
15841584
15851585 protected override float GetVisibleHeight ( MaterialProperty prop ) =>
15861586 EditorGUIUtility . singleLineHeight + 2.0f +
@@ -1742,7 +1742,7 @@ public ColorDrawer(string group, string color2, string color3, string color4)
17421742 this . _colorStrings [ 2 ] = color4 ;
17431743 }
17441744
1745- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Color ; }
1745+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Color ; }
17461746
17471747 public override void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData )
17481748 {
@@ -1786,7 +1786,7 @@ public override void DrawProp(Rect position, MaterialProperty prop, GUIContent l
17861786 r . xMax -= w * i - interval ;
17871787
17881788 var src = cProp . colorValue ;
1789- var isHdr = ( colorArray [ i ] . flags & MaterialProperty . PropFlags . HDR ) != MaterialProperty . PropFlags . None ;
1789+ var isHdr = ( colorArray [ i ] . GetPropertyFlags ( ) & ShaderPropertyFlags . HDR ) != ShaderPropertyFlags . None ;
17901790 var dst = EditorGUI . ColorField ( r , GUIContent . none , src , true , true , isHdr ) ;
17911791 if ( Helper . EndChangeCheck ( metaDatas , cProp ) )
17921792 {
@@ -1842,7 +1842,7 @@ public ChannelDrawer(string group)
18421842 this . group = group ;
18431843 }
18441844
1845- protected override bool IsMatchPropType ( MaterialProperty property ) { return property . type == MaterialProperty . PropType . Vector ; }
1845+ protected override bool IsMatchPropType ( MaterialProperty property ) { return property . GetPropertyType ( ) == ShaderPropertyType . Vector ; }
18461846
18471847 private static int GetChannelIndex ( MaterialProperty prop )
18481848 {
@@ -2241,8 +2241,8 @@ public PassSwitchDecorator(string lightModeName1, string lightModeName2, string
22412241
22422242 protected override bool IsMatchPropType ( MaterialProperty property )
22432243 {
2244- return property . type == MaterialProperty . PropType . Float
2245- || property . type == MaterialProperty . PropType . Int ;
2244+ return property . GetPropertyType ( ) == ShaderPropertyType . Float
2245+ || property . GetPropertyType ( ) == ShaderPropertyType . Int ;
22462246 }
22472247
22482248 public override void BuildStaticMetaData ( Shader inShader , MaterialProperty inProp , MaterialProperty [ ] inProps , PropertyStaticData inoutPropertyStaticData ) { }
0 commit comments