編集

次の方法で共有


Interpolator Class

Definition

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

public ref class Interpolator : UnityEngine::MonoBehaviour
[UnityEngine.AddComponentMenu("Scripts/MRTK/Core/Interpolator")]
public class Interpolator : UnityEngine.MonoBehaviour
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Core/Interpolator")>]
type Interpolator = class
    inherit MonoBehaviour
Public Class Interpolator
Inherits MonoBehaviour
Inheritance
UnityEngine.MonoBehaviour
Interpolator
Attributes
UnityEngine.AddComponentMenuAttribute

Constructors

Interpolator()

Properties

AnimatingLocalRotation

True if the transform's local rotation is animating; false otherwise.

AnimatingLocalScale

True if the transform's scale is animating; false otherwise.

AnimatingPosition

True if the transform's position is animating; false otherwise.

AnimatingRotation

True if the transform's rotation is animating; false otherwise.

PositionVelocity

The velocity of a transform whose position is being interpolated.

Running

True if position, rotation or scale are animating; false otherwise.

SmoothLerpToTarget

Lerp the estimated targets towards the object each update, slowing and smoothing movement.

SmoothPositionLerpRatio
SmoothRotationLerpRatio
SmoothScaleLerpRatio
TargetLocalRotation

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

TargetLocalScale

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

TargetPosition

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

TargetRotation

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

Methods

NonLinearInterpolateTo(Vector3, Vector3, Single, Single)

Interpolates smoothly to a target position.

Reset()

Stops the transform in place and terminates any animations.

SetTargetLocalRotation(Quaternion)

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

SetTargetLocalScale(Vector3)

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

SetTargetPosition(Vector3)

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

SetTargetRotation(Quaternion)

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

SnapToTarget()

Snaps to the final target and stops interpolating

StopInterpolating()

Stops the interpolation regardless if it has reached the target

Events

InterpolationDone

The event fired when an Interpolation is completed.

InterpolationStarted

The event fired when an Interpolation is started.

Applies to