colorswitcher - eisclimber/ExPresS-XR GitHub Wiki
Class in ExPresSXR.Misc.ColorSwitching
Inherits from UnityEngine.MonoBehaviour
Provides the option to switch materials of a renderer.
It is highly recommended to use a ColorAnimationSwitcher for more complex scenarios.
public class ColorSwitcher : MonoBehaviour| Name | Description |
|---|---|
| alternativeMaterial | The material that is replacing the material applied to the GameObject via Editor. |
| requireAlternativeMaterialMatch | When changing to the Alternative Material, the object's material must be the Original Material. |
| requireOriginalMaterialMatch | When changing to the Original Material, the object's material must be the Alternative Material. |
| switchDuration | The duration the material is switched when calling the '...ForSwitchDuration' functions. |
| Name | Description |
|---|---|
| ActivateAlternativeMaterial() | Activates the alternative material instantaneous. |
| ActivateAlternativeMaterialForASecond() | Activates the alternative material for a second switching back to the original. |
| ActivateAlternativeMaterialForSwitchDuration() | Activates the alternative material for a duration switching back to the original. |
| ActivateOriginalMaterial() | Activates the original material instantaneous. |
| ActivateOriginalMaterialForASecond() | Activates the original material for a second switching back to the alternative. |
| ActivateOriginalMaterialForSwitchDuration() | Activates the original material for a duration switching back to the alternative. |
| ToggleMaterial() | Toggles the material instantaneous. |
| ToggleMaterialForASecond() | Toggles the material for a second and toggles back afterwards. |
| ToggleMaterialForSwitchDuration() | Toggles the material for a duration and toggles back afterwards. |