Guides
Guides
These docs are for v3.1.0. Click to read the latest docs for v3.3.0.

VRTK_MaterialPropertyBlockColorSwapHighlighter

extends VRTK_MaterialColorSwapHighlighter

Overview

This highlighter swaps the texture colour for the given highlight colour using MaterialPropertyBlocks.
The effect of this highlighter is the same as of the VRTK_MaterialColorSwapHighlighter.cs but this highlighter can additionally handle objects which make use material instances.

Due to the way the object material is interacted with, changing the material colour will break Draw Call Batching in Unity whilst the object is highlighted.

The Draw Call Batching will resume on the original material when the item is no longer highlighted.

Class Methods

Initialise/2

public override void Initialise(Color? color = null, Dictionary<string, object> options = null)

  • Parameters
  • Color? color - Not used.
  • Dictionary<string, object> options - A dictionary array containing the highlighter options:\r * <'resetMainTexture', bool> - Determines if the default main texture should be cleared on highlight. true to reset the main default texture, false to not reset it.
  • Returns
  • none

The Initialise method sets up the highlighter for use.

Unhighlight/2

public override void Unhighlight(Color? color = null, float duration = 0f)

  • Parameters
  • Color? color - Not used.
  • float duration - Not used.
  • Returns
  • none

The Unhighlight method returns the object back to it's original colour.