Show / Hide Table of Contents

class LerpFuncFactory

Helpers for creating configurable interpolation functions.

Syntax
public static class LerpFuncFactory

Methods

View Source

CreateShake(Int32, Single, Single, Single, Single)

Create a interpolation function that shakes a Vector2 on both axes.

Declaration
public static LerpFunc<Vector3> CreateShake(int oscillationCount, float amplitudeDecay = 1F, float frequencyDecay = 1F, float amplitudeRandomness = 0F, float frequencyRandomness = 0F)
Parameters
Type Name Description
System.Int32 oscillationCount

Number of oscillations per axis.

System.Single amplitudeDecay

Rate at which amplitude decreases over time.

System.Single frequencyDecay

Rate at which frequency decreases over time.

System.Single amplitudeRandomness

Maximum percentage change randomly applied to amplitude per axis.

System.Single frequencyRandomness

Maximum percentage change randomly applied to frequency per axis.

Returns
Type Description
LerpFunc<UnityEngine.Vector3>

The shake interpolation function.

View Source

CreateShake2D(Int32, Single, Single, Single, Single)

Create a interpolation function that shakes a Vector3 on all axes.

Declaration
public static LerpFunc<Vector2> CreateShake2D(int oscillationCount, float amplitudeDecay = 1F, float frequencyDecay = 1F, float amplitudeRandomness = 0F, float frequencyRandomness = 0F)
Parameters
Type Name Description
System.Int32 oscillationCount

Number of oscillations per axis.

System.Single amplitudeDecay

Rate at which amplitude decreases over time.

System.Single frequencyDecay

Rate at which frequency decreases over time.

System.Single amplitudeRandomness

Maximum percentage change randomly applied to amplitude per axis.

System.Single frequencyRandomness

Maximum percentage change randomly applied to frequency per axis.

Returns
Type Description
LerpFunc<UnityEngine.Vector2>

The shake interpolation function.

  • View Source
On this page
Back to top Generated by DocFX