# MMotion.Punch

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

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public static class Punch
```

[Runtime/Adapters/Vibration/VibrationMotion.cs · L38](../../source/Runtime/Adapters/Vibration/VibrationMotion.cs.html#L38)

## 振動の終点を確認する

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

```csharp
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の強さを指定できます。

```csharp
public static MotionBuilder<float, PunchOptions, FloatPunchMotionAdapter> Create(float startValue, float strength, float duration)
```

引数と戻り値

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

[Runtime/Adapters/Vibration/VibrationMotion.cs · L40](../../source/Runtime/Adapters/Vibration/VibrationMotion.cs.html#L40)

```csharp
public static MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter> Create(Vector2 startValue, Vector2 strength, float duration)
```

引数と戻り値

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

[Runtime/Adapters/Vibration/VibrationMotion.cs · L43](../../source/Runtime/Adapters/Vibration/VibrationMotion.cs.html#L43)

```csharp
public static MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter> Create(Vector3 startValue, Vector3 strength, float duration)
```

引数と戻り値

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

[Runtime/Adapters/Vibration/VibrationMotion.cs · L46](../../source/Runtime/Adapters/Vibration/VibrationMotion.cs.html#L46)
