CVR Global Material Property Updater
Updates a material property on the assigned material, and on every instanced copy of that material it can find on the current CVR Spawnable or on world-wide renderers and Blitters. Since Unity copies the material at first access, the component fans the write out to keep every copy in sync.
Properties
Section titled “Properties”Material
Section titled “Material”The Material to modify.
Property Name
Section titled “Property Name”The variable or property name in the shader.
Property Type
Section titled “Property Type”Data type of the property.
- paramInt Uses
Material.SetInt. Animatable viaintValueAnimatable. - paramFloat Uses
Material.SetFloat. Animatable viafloatValueAnimatable. Default. - paramVector4 Uses
Material.SetVector. Animatable viavector4ValueAnimatable. - paramInteger Uses
Material.SetInteger. Animatable viaintegerValueAnimatable.
Value applied to the shader. The animatable field corresponding to the selected Property Type is the one the inspector and animations write to. OnDidApplyAnimationProperties flushes the animatable field into the underlying runtime value if it changed.
Child material detection
Section titled “Child material detection”At Start, the component searches for material instances that share the original material’s name (ignoring (Instance) / (Clone) suffixes) and shader. Sources searched:
- If the component sits under a CVR Spawnable, every Renderer and CVR Blitter underneath that spawnable.
- Otherwise, every material registered to the active world (
CVRWorld.Instance.MaterialsInWorld).
Every matched copy receives the same property write.
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRGlobalMaterialPropertyUpdater.cs