Show / Hide Table of Contents

Class SimpleInterpolator

A Unity component that interpolates a transform's position, rotation or scale.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
SimpleInterpolator
Inherited Members
UnityEngine.MonoBehaviour.IsInvoking()
UnityEngine.MonoBehaviour.CancelInvoke()
UnityEngine.MonoBehaviour.Invoke(System.String, System.Single)
UnityEngine.MonoBehaviour.InvokeRepeating(System.String, System.Single, System.Single)
UnityEngine.MonoBehaviour.CancelInvoke(System.String)
UnityEngine.MonoBehaviour.IsInvoking(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String, System.Object)
UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(UnityEngine.Coroutine)
UnityEngine.MonoBehaviour.StopCoroutine(System.String)
UnityEngine.MonoBehaviour.StopAllCoroutines()
UnityEngine.MonoBehaviour.print(System.Object)
UnityEngine.MonoBehaviour.useGUILayout
UnityEngine.MonoBehaviour.runInEditMode
UnityEngine.Behaviour.enabled
UnityEngine.Behaviour.isActiveAndEnabled
UnityEngine.Component.GetComponent(System.Type)
UnityEngine.Component.GetComponent<T>()
UnityEngine.Component.GetComponent(System.String)
UnityEngine.Component.GetComponentInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInChildren(System.Type)
UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentInChildren<T>()
UnityEngine.Component.GetComponentsInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInChildren(System.Type)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInChildren<T>()
UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentInParent(System.Type)
UnityEngine.Component.GetComponentInParent<T>()
UnityEngine.Component.GetComponentsInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInParent(System.Type)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInParent<T>()
UnityEngine.Component.GetComponents(System.Type)
UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponents<T>()
UnityEngine.Component.CompareTag(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object)
UnityEngine.Component.SendMessageUpwards(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, System.Object)
UnityEngine.Component.SendMessage(System.String)
UnityEngine.Component.SendMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object)
UnityEngine.Component.BroadcastMessage(System.String)
UnityEngine.Component.BroadcastMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.transform
UnityEngine.Component.gameObject
UnityEngine.Component.tag
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: IMLD.MixedRealityAnalysis.Utils
Assembly: Assembly-CSharp.dll
Syntax
public class SimpleInterpolator : MonoBehaviour

Properties

AnimatingLocalPosition

Gets a value indicating whether the transform's local position is animating.

Declaration
public bool AnimatingLocalPosition { get; }
Property Value
Type Description
System.Boolean

AnimatingLocalRotation

Gets a value indicating whether the transform's local rotation is animating.

Declaration
public bool AnimatingLocalRotation { get; }
Property Value
Type Description
System.Boolean

AnimatingLocalScale

Gets a value indicating whether the transform's scale is animating.

Declaration
public bool AnimatingLocalScale { get; }
Property Value
Type Description
System.Boolean

AnimatingPosition

Gets a value indicating whether the transform's position is animating.

Declaration
public bool AnimatingPosition { get; }
Property Value
Type Description
System.Boolean

AnimatingRotation

Gets a value indicating whether the transform's rotation is animating.

Declaration
public bool AnimatingRotation { get; }
Property Value
Type Description
System.Boolean

PositionVelocity

Gets the velocity of a transform whose position is being interpolated.

Declaration
public Vector3 PositionVelocity { get; }
Property Value
Type Description
UnityEngine.Vector3

Running

Gets a value indicating whether the position, rotation or scale are animating.

Declaration
public bool Running { get; }
Property Value
Type Description
System.Boolean

SmoothLerpToTarget

Gets or sets a value indicating whether the estimated targets lerp towards the object each update, slowing and smoothing movement.

Declaration
public bool SmoothLerpToTarget { get; set; }
Property Value
Type Description
System.Boolean

SmoothPositionLerpRatio

Gets or sets the smoothness of the position lerp.

Declaration
public float SmoothPositionLerpRatio { get; set; }
Property Value
Type Description
System.Single

SmoothRotationLerpRatio

Gets or sets the smoothness of the rotation lerp.

Declaration
public float SmoothRotationLerpRatio { get; set; }
Property Value
Type Description
System.Single

SmoothScaleLerpRatio

Gets or sets the smoothness of the scale lerp.

Declaration
public float SmoothScaleLerpRatio { get; set; }
Property Value
Type Description
System.Single

TargetLocalPosition

If animating position, specifies the target local position as specified by SetTargetPosition. Otherwise returns the current local position of the transform.

Declaration
public Vector3 TargetLocalPosition { get; }
Property Value
Type Description
UnityEngine.Vector3

TargetLocalRotation

If animating local rotation, specifies the target local rotation as specified by SetTargetLocalRotation. Otherwise returns the current local rotation of the transform.

Declaration
public Quaternion TargetLocalRotation { get; }
Property Value
Type Description
UnityEngine.Quaternion

TargetLocalScale

If animating local scale, specifies the target local scale as specified by SetTargetLocalScale. Otherwise returns the current local scale of the transform.

Declaration
public Vector3 TargetLocalScale { get; }
Property Value
Type Description
UnityEngine.Vector3

TargetPosition

If animating position, specifies the target position as specified by SetTargetPosition. Otherwise returns the current position of the transform.

Declaration
public Vector3 TargetPosition { get; }
Property Value
Type Description
UnityEngine.Vector3

TargetRotation

If animating rotation, specifies the target rotation as specified by SetTargetRotation. Otherwise returns the current rotation of the transform.

Declaration
public Quaternion TargetRotation { get; }
Property Value
Type Description
UnityEngine.Quaternion

Methods

NonLinearInterpolateTo(Vector3, Vector3, Single, Single)

Interpolates smoothly to a target position.

Declaration
public static Vector3 NonLinearInterpolateTo(Vector3 start, Vector3 target, float deltaTime, float speed)
Parameters
Type Name Description
UnityEngine.Vector3 start

The starting position.

UnityEngine.Vector3 target

The destination position.

System.Single deltaTime

Caller-provided Time.deltaTime.

System.Single speed

The speed to apply to the interpolation.

Returns
Type Description
UnityEngine.Vector3

New interpolated position closer to target

Reset()

Stops the transform in place and terminates any animations.

Declaration
public void Reset()
Remarks

Reset() is usually reserved as a UnityEngine.MonoBehaviour API call in editor, but is used in this case as a convenience method.

SetTargetLocalPosition(Vector3)

Sets the target local position for the transform and if position wasn't already animating, fires the InterpolationStarted event.

Declaration
public void SetTargetLocalPosition(Vector3 target)
Parameters
Type Name Description
UnityEngine.Vector3 target

The new target position to for the transform.

SetTargetLocalRotation(Quaternion)

Sets the target local rotation for the transform and if rotation wasn't already animating, fires the InterpolationStarted event.

Declaration
public void SetTargetLocalRotation(Quaternion target)
Parameters
Type Name Description
UnityEngine.Quaternion target

The new target local rotation for the transform.

SetTargetLocalScale(Vector3)

Sets the target local scale for the transform and if scale wasn't already animating, fires the InterpolationStarted event.

Declaration
public void SetTargetLocalScale(Vector3 target)
Parameters
Type Name Description
UnityEngine.Vector3 target

The new target local rotation for the transform.

SetTargetPosition(Vector3)

Sets the target position for the transform and if position wasn't already animating, fires the InterpolationStarted event.

Declaration
public void SetTargetPosition(Vector3 target)
Parameters
Type Name Description
UnityEngine.Vector3 target

The new target position to for the transform.

SetTargetRotation(Quaternion)

Sets the target rotation for the transform and if rotation wasn't already animating, fires the InterpolationStarted event.

Declaration
public void SetTargetRotation(Quaternion target)
Parameters
Type Name Description
UnityEngine.Quaternion target

The new target rotation for the transform.

SnapToTarget()

Snaps to the final target and stops interpolating

Declaration
public void SnapToTarget()

StopInterpolating()

Stops the interpolation regardless if it has reached the target

Declaration
public void StopInterpolating()

Events

InterpolationDone

The event fired when an Interpolation is completed.

Declaration
public event Action InterpolationDone
Event Type
Type Description
System.Action

InterpolationStarted

The event fired when an Interpolation is started.

Declaration
public event Action InterpolationStarted
Event Type
Type Description
System.Action
In This Article
Back to top Generated by DocFX