MeatMotion

MMotion.Punch

初期値に振動を加えて戻すTweenを作ります。float、Vector2、Vector3の強さを指定できます。

Namespace
MeatMotion
Assembly
MeatMotion

メンバー一覧へ

public static class Punch
VibrationMotion.cs · L38

振動の終点を確認する

using MeatMotion; を追加します。第2引数は振幅です。この例は1秒後に開始値3に戻ります。

float value = 0f;
using var world = new MotionWorld();
var punch = MMotion.Punch.Create(3f, 2f, 1f)
    .WithFrequency(5).WithDampingRatio(1f)
    .WithScheduler(world).Bind(v => value = v);
punch.Complete();

メンバー

Create

初期値に振動を加えて戻すTweenを作ります。float、Vector2、Vector3の強さを指定できます。

public static MotionBuilder<float, PunchOptions, FloatPunchMotionAdapter> Create(float startValue, float strength, float duration)
引数と戻り値
startValue
float 補間の開始値。
strength
float 基準値からの振動の強さ。終点を表す値とは扱いが異なります。
duration
float 開始から終了までの秒数。
戻り値
MotionBuilder<float, PunchOptions, FloatPunchMotionAdapter>
public static MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter> Create(Vector2 startValue, Vector2 strength, float duration)
引数と戻り値
startValue
Vector2 補間の開始値。
strength
Vector2 基準値からの振動の強さ。終点を表す値とは扱いが異なります。
duration
float 開始から終了までの秒数。
戻り値
MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter>
public static MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter> Create(Vector3 startValue, Vector3 strength, float duration)
引数と戻り値
startValue
Vector3 補間の開始値。
strength
Vector3 基準値からの振動の強さ。終点を表す値とは扱いが異なります。
duration
float 開始から終了までの秒数。
戻り値
MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter>