Class vGear_Transformer
Transform object by uniformed acceleration motion.
以勻加速運動變換物件。
Inheritance
Namespace: Votanic.vXR.vGear
Assembly: Votanic.vXR.dll
Syntax
[AddComponentMenu("")]
public class vGear_Transformer : MonoBehaviour
Fields
isPaused
Return true if the transformation is paused.
當變換暫停時傳回 true。
Declaration
[Tooltip("Return true if the transformation is paused.\n當變換暫停時傳回 true。")]
public bool isPaused
Field Value
Type | Description |
---|---|
System.Boolean |
isTransforming
Return true if object is transforming.
當物件變換時傳回 true。
Declaration
[Header("[Status]")]
[Tooltip("Return true if object is transforming.\n當物件變換時傳回 true。")]
public bool isTransforming
Field Value
Type | Description |
---|---|
System.Boolean |
transformation
Transformation setting.
變換設定。
Declaration
[Header("[Settings]")]
[Tooltip("Transformation setting.\n變換設定。")]
public Transformation transformation
Field Value
Type | Description |
---|---|
Transformation |
Methods
Move(Vector3, Int32, Single)
Move object.
移動物件。
Move(new Vector3(0, 0, 1))
Declaration
public void Move(Vector3 movement, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | movement | Position change |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
Move(Vector3, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Move object by custom setting.
以自定義設定移動物件。
Move(new Vector3(0, 0, 1), 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void Move(Vector3 movement, float factor, float accel, float decel, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | movement | Position change |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
MoveTo(Vector3, Int32, Single)
Move object to target position.
移動物件至目標位置。
MoveTo(new Vector3(0, 0, 1))
Declaration
public void MoveTo(Vector3 position, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | position | Target position |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
MoveTo(Vector3, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Move object to target position by custom setting.
以自定義設定移動物件至目標位置。
MoveTo(new Vector3(0, 0, 1), 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void MoveTo(Vector3 position, float factor, float accel, float decel, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | position | Target position |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
Pause()
Pause all transformations.
暫停所有變換過程。
Declaration
public void Pause()
Rotate(Vector3, Int32, Single)
Rotate object.
旋轉物件。
Rotate(new Vector3(0, 90, 0))
Declaration
public void Rotate(Vector3 rotation, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | rotation | Rotation angles |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
Rotate(Vector3, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Rotate object by custom setting.
以自定義設定旋轉物件。
Rotate(new Vector3(0, 90, 0), 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void Rotate(Vector3 rotation, float factor, float accel, float decel, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | rotation | Rotation angles |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
RotateTo(Vector3, Int32, Single)
Rotate object to target euler angles.
旋轉物件至目標角度。
Rotate(new Vector3(0, 90, 0))
Declaration
public void RotateTo(Vector3 eulerAngles, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | eulerAngles | Target euler angles |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
RotateTo(Vector3, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Rotate object to target euler angles by custom setting.
以自定義設定旋轉物件至目標角度。
RotateTo(new Vector3(0, 90, 0), 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void RotateTo(Vector3 eulerAngles, float factor, float accel, float decel, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | eulerAngles | Target euler angles |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
Scale(Vector3, Int32, Single)
Scaling object.
縮放物件。
Scale(new Vector3(1, 1, 1))
Declaration
public void Scale(Vector3 scaling, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | scaling | Scaling value |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
Scale(Vector3, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Scaling object by custom setting.
以自定義設定縮放物件。
Scale(new Vector3(1, 1, 1), 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void Scale(Vector3 scaling, float factor, float accel, float decel, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | scaling | Scaling value |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
ScaleTo(Vector3, Int32, Single)
Scaling object to target scale.
縮放物件至目標大小。
ScaleTo(new Vector3(2, 2, 2))
Declaration
public void ScaleTo(Vector3 scale, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | scale | Target scale |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
ScaleTo(Vector3, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Scaling object to target scale by custom setting.
以自定義設定縮放物件至目標大小。
ScaleTo(new Vector3(2, 2, 2), 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void ScaleTo(Vector3 scale, float factor, float accel, float decel, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | scale | Target scale |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
Stop()
Stop all transformations.
停止所有變換過程。
Declaration
public void Stop()
Transform(List<Coordinate>, Int32, Single)
Transform object to target coordinates.
以自定義設定將物件變換到目標座標系統。
Transform(coordinates)
Declaration
public void Transform(List<Coordinate> coordinates, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Coordinate> | coordinates | Target coordinates |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
Transform(List<Coordinate>, Single, Single, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Transform object to target coordinates by custom setting.
以自定義設定將物件變換到目標座標系統。
Transform(coordinates, 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void Transform(List<Coordinate> coordinates, float factor, float accel, float decel, float rotationRatio, float scalingRatio, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Coordinate> | coordinates | Target coordinates |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
System.Single | rotationRatio | Relatively rotation angle with 1 metre movement |
System.Single | scalingRatio | Relatively scaling size with 1 metre movement |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
Transform(Vector3, Vector3, Vector3, Int32, Single)
Transform object.
將物件變換。
Transform(new Vector3(0, 0, 1), Vector3.zero, Vector3.zero)
Declaration
public void Transform(Vector3 movement, Vector3 rotation, Vector3 scaling, int repeatTimes = 0, float gap = 0F)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | movement | Position change |
UnityEngine.Vector3 | rotation | Euler angle change |
UnityEngine.Vector3 | scaling | Scale change |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
Transform(Vector3, Vector3, Vector3, Single, Single, Single, Single, Single, MotionParameter, SinglePointRepeat, Int32, Single, Boolean)
Transform object by custom setting.
以自定義設定將物件變換。
Transform(new Vector3(0, 0, 1), Vector3.zero, Vector3.zero, 1, 0, 0, 45, 2, MotionParameter.Time, SinglePointRepeat.None)
Declaration
public void Transform(Vector3 movement, Vector3 rotation, Vector3 scaling, float factor, float accel, float decel, float rotationRatio, float scalingRatio, MotionParameter parameter, SinglePointRepeat repeat = SinglePointRepeat.None, int repeatTimes = 0, float gap = 0F, bool unscaledDeltaTime = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | movement | Position change |
UnityEngine.Vector3 | rotation | Euler angle change |
UnityEngine.Vector3 | scaling | Scale change |
System.Single | factor | Transformation factor |
System.Single | accel | Transformation accelerating value |
System.Single | decel | Transformation decelerating value |
System.Single | rotationRatio | Relatively rotation angle with 1 metre movement |
System.Single | scalingRatio | Relatively scaling size with 1 metre movement |
MotionParameter | parameter | Transformation calculation parameter |
SinglePointRepeat | repeat | Single point repeat type |
System.Int32 | repeatTimes | Repeat action times |
System.Single | gap | Delay between actions |
System.Boolean | unscaledDeltaTime | Using unscaled delta time if true |
UnPause()
UnPause all transformations.
取消暫停所有變換過程。
Declaration
public void UnPause()