Skip to content

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.

The Material to modify.

The variable or property name in the shader.

Data type of the property.

  • paramInt Uses Material.SetInt. Animatable via intValueAnimatable.
  • paramFloat Uses Material.SetFloat. Animatable via floatValueAnimatable. Default.
  • paramVector4 Uses Material.SetVector. Animatable via vector4ValueAnimatable.
  • paramInteger Uses Material.SetInteger. Animatable via integerValueAnimatable.

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.

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.

  • CVR-GameFiles/ABI.CCK.Components/CVRGlobalMaterialPropertyUpdater.cs