Skip to content

Utilities

Simon edited this page Apr 21, 2021 · 5 revisions

Namespace: WIDVE.Utilities
Location: WIDVE Unity Scripts/Utilities

The Utilities namespace contains scripts that don't fit into any other specific category. Many of these scripts or components are used by scripts in other namespaces.

Components

Interpolator

InterpolatorEvent

This is a simple script designed for use with UnityEvents. It provides an interface so that an Interpolator's lerp methods can be called from a UnityEvent with customizable time values. It also provides a customizable envelope that can perform a more complicated interpolation sequence when the PlayEnvelope() function is called.

Property Description
Envelope.x The Attack value of the envelope. The Interpolator will lerp from 0 to 1 using this time value.
Envelope.y The Hold value of the envelope. The Interplator will stay at a value of 1 for this amount of time.
Envelope.z The Release value of the envelope. The Interpolator will lerp from 1 to 0 using this time value.

Interfaces

IInterpolatable

The IInterpolatable interface must be used by any component able to be controlled by an Interpolator.

Property/Function Description
Enabled Returns whether this script is enabled. For components, should simply return the current enabled value.
FunctionWhenDisabled If true, the script will respond to changes in Interpolator value even when Enabled is false.
SetValue(float value) This function is called by the Interpolator whenever its value changes. It should contain logic that updates the interpolatable component to use the new value.

Clone this wiki locally