MMotion.Punch
初期値に振動を加えて戻すTweenを作ります。float、Vector2、Vector3の強さを指定できます。
public static class PunchVibrationMotion.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)引数と戻り値
startValuefloat補間の開始値。strengthfloat基準値からの振動の強さ。終点を表す値とは扱いが異なります。durationfloat開始から終了までの秒数。- 戻り値
MotionBuilder<float, PunchOptions, FloatPunchMotionAdapter>
public static MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter> Create(Vector2 startValue, Vector2 strength, float duration)引数と戻り値
startValueVector2補間の開始値。strengthVector2基準値からの振動の強さ。終点を表す値とは扱いが異なります。durationfloat開始から終了までの秒数。- 戻り値
MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter>
public static MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter> Create(Vector3 startValue, Vector3 strength, float duration)引数と戻り値
startValueVector3補間の開始値。strengthVector3基準値からの振動の強さ。終点を表す値とは扱いが異なります。durationfloat開始から終了までの秒数。- 戻り値
MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter>
MeatMotion