Search Issue Tracker
By Design
Votes
0
Found in
2022.3.65f1
6000.0.54f1
6000.1.13f1
6000.2.0b10
6000.3.0a2
Issue ID
UUM-112975
Regression
No
Material does not update when setting an enum keyword using EnableKeyword
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/DevDunkStudio/Depth Shadows/Demo/Scenes/DepthShadowDemo.unity“ Scene
3. Double-click on the “ShadowPlane” GameObject in the Hierarchy window (Zoom in the Scene view if the shadow isn’t visible)
4. In the Inspector window, under the “Depth Shadows” component, change the Sample Type
5. Observe the shadow in the Scene view
Expected result: Material updates based on the selected Sample Type
Actual result: Material remains unchanged
Reproducible with: 2022.3.65f1, 6000.0.54f1, 6000.1.13f1, 6000.2.0b10, 6000.3.0a2
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Workaround: Manually disable all enum keywords before enabling the selected one (uncomment lines 202-204 in DepthShadow.cs)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Resolution Note:
We don't officially support an API entry point for keyword enum at the moment- something we are aware of and plan on improving. So yes- you need to explicitly disable all other keywords. You can write a helper to do this, such as the following:
(please excuse the formatting)
public static void SetLocalKeywordEnum(Material mat, string referenceName, string value)
{
foreach (var keyword in mat.enabledKeywords)
if (keyword.name.StartsWith(referenceName))
mat.DisableKeyword(keyword);
mat.EnableKeyword($"{referenceName}_{value}");
}