@@ -182,9 +182,15 @@ void BuildExposedField(PropertySheet propertySheet)
182
182
propertySheet . Add ( toggleDataPropertyDrawer . CreateGUI (
183
183
evt =>
184
184
{
185
+ if ( shaderInput is AbstractShaderProperty property &&
186
+ ( ! property . overrideHLSLDeclaration || property . hlslDeclarationOverride == HLSLDeclaration . DoNotDeclare ) )
187
+ {
188
+ property . hlslDeclarationOverride = property . GetDefaultHLSLDeclaration ( ) ;
189
+ property . overrideHLSLDeclaration = true ;
190
+ }
185
191
this . _preChangeValueCallback ( "Change Exposed Toggle" ) ;
186
192
this . _exposedFieldChangedCallback ( evt . isOn ) ;
187
- this . _postChangeValueCallback ( false , ModificationScope . Graph ) ;
193
+ this . _postChangeValueCallback ( true , ModificationScope . Graph ) ;
188
194
} ,
189
195
new ToggleData ( shaderInput . isExposed ) ,
190
196
shaderInput is ShaderKeyword ? "Generate Material Property" : "Show In Inspector" ,
@@ -529,8 +535,11 @@ void BuildHLSLDeclarationOverrideFields(PropertySheet propertySheet, AbstractSha
529
535
property . hlslDeclarationOverride = evt . newValue ;
530
536
property . overrideHLSLDeclaration = true ;
531
537
UpdateEnableState ( ) ;
532
- this . _exposedFieldChangedCallback ( evt . newValue != HLSLDeclaration . Global ) ;
533
- property . generatePropertyBlock = evt . newValue != HLSLDeclaration . Global ;
538
+ if ( ( evt . newValue == HLSLDeclaration . Global ) ^ ( evt . previousValue == HLSLDeclaration . Global ) )
539
+ {
540
+ this . _exposedFieldChangedCallback ( evt . newValue != HLSLDeclaration . Global ) ;
541
+ property . generatePropertyBlock = evt . newValue != HLSLDeclaration . Global ;
542
+ }
534
543
this . _postChangeValueCallback ( true , ModificationScope . Graph ) ;
535
544
} ) ;
536
545
@@ -562,7 +571,7 @@ void BuildPrecisionField(PropertySheet propertySheet, AbstractShaderProperty pro
562
571
563
572
void HandleVector1ShaderProperty ( PropertySheet propertySheet , Vector1ShaderProperty vector1ShaderProperty )
564
573
{
565
- var floatType = isCurrentPropertyGlobal ? FloatType . Default : vector1ShaderProperty . floatType ;
574
+ var floatType = ( isSubGraph || isCurrentPropertyGlobal ) ? FloatType . Default : vector1ShaderProperty . floatType ;
566
575
// Handle vector 1 mode parameters
567
576
switch ( floatType )
568
577
{
@@ -1440,6 +1449,8 @@ void KeywordAddCallbacks()
1440
1449
1441
1450
if ( EditorGUI . EndChangeCheck ( ) )
1442
1451
{
1452
+ this . _preChangeValueCallback ( "Edit Enum Keyword Entry" ) ;
1453
+
1443
1454
displayName = GetSanitizedDisplayName ( displayName ) ;
1444
1455
referenceName = GetSanitizedReferenceName ( displayName . ToUpper ( ) ) ;
1445
1456
var duplicateIndex = FindDuplicateKeywordReferenceNameIndex ( entry . id , referenceName ) ;
@@ -1560,6 +1571,7 @@ void KeywordRemoveEntry(ReorderableList list)
1560
1571
1561
1572
void KeywordReorderEntries ( ReorderableList list )
1562
1573
{
1574
+ this . _preChangeValueCallback ( "Reorder Keyword Entry" ) ;
1563
1575
this . _postChangeValueCallback ( true ) ;
1564
1576
}
1565
1577
@@ -1619,7 +1631,6 @@ void BuildDropdownFields(PropertySheet propertySheet, ShaderInput shaderInput)
1619
1631
return ;
1620
1632
1621
1633
BuildDropdownField ( propertySheet , dropdown ) ;
1622
- BuildExposedField ( propertySheet ) ;
1623
1634
}
1624
1635
1625
1636
void BuildDropdownField ( PropertySheet propertySheet , ShaderDropdown dropdown )
0 commit comments