# UGUIMotionExtensions

uGUIのGraphic、Text、Image、CanvasGroupを更新します。色のチャンネル、表示する文字列、塗りつぶし量などを選べます。

Namespace: MeatMotion.Extensions

Assembly: MeatMotion.UI

```csharp
public static partial class UGUIMotionExtensions
```

使用条件　com.unity.ugui

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L7](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L7)

## CanvasGroupの透明度を変える

対象にCanvasGroupを付け、MonoBehaviourから実行します。`using MeatMotion;`、`using MeatMotion.Extensions;`、`using UnityEngine;` と、独自asmdefの場合は `MeatMotion.UI` の参照を追加します。

```csharp
var group = gameObject.GetComponent<CanvasGroup>();
var fade = MMotion.Create(0f, 1f, 0.4f)
    .BindToAlpha(group).AddTo(gameObject);
```

## BindToColor

対象のColorに補間値を書き込むTweenを登録し、MotionHandleを返します。

```csharp
public static MotionHandle BindToColor<TOptions, TAdapter>(this MotionBuilder<Color, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Color, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<Color, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L9](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L9)

## BindToColorR

ColorのRチャンネルだけを更新し、残りの色成分は現在値を保ちます。

```csharp
public static MotionHandle BindToColorR(this FloatMotionBuilder builder, Graphic graphic)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L14](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L14)

```csharp
public static MotionHandle BindToColorR<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L17](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L17)

## BindToColorG

ColorのGチャンネルだけを更新し、残りの色成分は現在値を保ちます。

```csharp
public static MotionHandle BindToColorG(this FloatMotionBuilder builder, Graphic graphic)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L27](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L27)

```csharp
public static MotionHandle BindToColorG<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L30](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L30)

## BindToColorB

ColorのBチャンネルだけを更新し、残りの色成分は現在値を保ちます。

```csharp
public static MotionHandle BindToColorB(this FloatMotionBuilder builder, Graphic graphic)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L40](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L40)

```csharp
public static MotionHandle BindToColorB<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L43](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L43)

## BindToColorA

ColorのAチャンネルだけを更新し、残りの色成分は現在値を保ちます。

```csharp
public static MotionHandle BindToColorA(this FloatMotionBuilder builder, Graphic graphic)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L53](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L53)

```csharp
public static MotionHandle BindToColorA<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `graphic` (`Graphic`) 値を適用する対象（Graphic）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L56](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L56)

## BindToFillAmount

Image.fillAmountにfloatをバインドします。

```csharp
public static MotionHandle BindToFillAmount(this FloatMotionBuilder builder, Image image)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `image` (`Image`) 値を適用する対象（Image）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L66](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L66)

```csharp
public static MotionHandle BindToFillAmount<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Image image)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `image` (`Image`) 値を適用する対象（Image）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L69](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L69)

## BindToAlpha

CanvasGroup.alphaにfloatをバインドし、グループの表示をフェードさせます。

```csharp
public static MotionHandle BindToAlpha(this FloatMotionBuilder builder, CanvasGroup canvasGroup)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `canvasGroup` (`CanvasGroup`) 値を適用する対象（CanvasGroup）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L74](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L74)

```csharp
public static MotionHandle BindToAlpha<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, CanvasGroup canvasGroup)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `canvasGroup` (`CanvasGroup`) 値を適用する対象（CanvasGroup）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L77](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L77)

## BindToFontSize

対象のFontSizeに補間値を書き込むTweenを登録し、MotionHandleを返します。

```csharp
public static MotionHandle BindToFontSize<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<int, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<int, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L82](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L82)

## BindToText

補間した文字列や数値をテキストに反映します。数値の書式を指定する形式ではformatを渡します。

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString32Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString32Bytes, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<FixedString32Bytes, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L87](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L87)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString64Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString64Bytes, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<FixedString64Bytes, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L92](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L92)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString128Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString128Bytes, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<FixedString128Bytes, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L97](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L97)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString512Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString512Bytes, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<FixedString512Bytes, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L102](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L102)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString4096Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString4096Bytes, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<FixedString4096Bytes, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L107](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L107)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<int, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<int, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L112](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L112)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text, string format)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<int, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<int, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- `format` (`string`) 補間した値を文字列に変換する書式。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L117](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L117)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<long, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<long, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<long, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L122](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L122)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<long, TOptions, TAdapter> builder, Text text, string format)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<long, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<long, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- `format` (`string`) 補間した値を文字列に変換する書式。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L127](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L127)

```csharp
public static MotionHandle BindToText(this FloatMotionBuilder builder, Text text)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L132](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L132)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L135](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L135)

```csharp
public static MotionHandle BindToText(this FloatMotionBuilder builder, Text text, string format)
```

引数と戻り値

- `builder` (`this FloatMotionBuilder`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- `format` (`string`) 補間した値を文字列に変換する書式。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L140](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L140)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Text text, string format)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

引数と戻り値

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
- `text` (`Text`) 値を適用する対象（Text）。
- `format` (`string`) 補間した値を文字列に変換する書式。
- 戻り値: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L143](../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L143)
