UGUIMotionExtensions
Update uGUI graphics, text, images and canvas groups. Bind a color channel, text value, fill amount or alpha.
public static partial class UGUIMotionExtensionsRequires com.unity.ugui
Fade a CanvasGroup
Attach a CanvasGroup to the target GameObject. In a MonoBehaviour, import MeatMotion, MeatMotion.Extensions and UnityEngine. Add MeatMotion.UI if using an assembly definition.
var group = gameObject.GetComponent<CanvasGroup>();
var fade = MMotion.Create(0f, 1f, 0.4f)
.BindToAlpha(group).AddTo(gameObject);
Members
- BindToColor
- BindToColorR
- BindToColorG
- BindToColorB
- BindToColorA
- BindToFillAmount
- BindToAlpha
- BindToFontSize
- BindToText
BindToColor
Schedule a tween that writes the interpolated value to Color on the bound target and return its MotionHandle.
public static MotionHandle BindToColor<TOptions, TAdapter>(this MotionBuilder<Color, TOptions, TAdapter> builder, Graphic graphic)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<Color, TOptions>Parameters and return value
builderthis MotionBuilder<Color, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
BindToColorR
Update only the R channel of Color, retaining the other color components.
public static MotionHandle BindToColorR(this FloatMotionBuilder builder, Graphic graphic)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
public static MotionHandle BindToColorR<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
BindToColorG
Update only the G channel of Color, retaining the other color components.
public static MotionHandle BindToColorG(this FloatMotionBuilder builder, Graphic graphic)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
public static MotionHandle BindToColorG<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
BindToColorB
Update only the B channel of Color, retaining the other color components.
public static MotionHandle BindToColorB(this FloatMotionBuilder builder, Graphic graphic)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
public static MotionHandle BindToColorB<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
BindToColorA
Update only the A channel of Color, retaining the other color components.
public static MotionHandle BindToColorA(this FloatMotionBuilder builder, Graphic graphic)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
public static MotionHandle BindToColorA<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.graphicGraphicTarget Graphic that receives the update.- Returns
MotionHandle
BindToFillAmount
Bind a float to Image.fillAmount.
public static MotionHandle BindToFillAmount(this FloatMotionBuilder builder, Image image)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.imageImageTarget Image that receives the update.- Returns
MotionHandle
public static MotionHandle BindToFillAmount<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Image image)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.imageImageTarget Image that receives the update.- Returns
MotionHandle
BindToAlpha
Bind a float to CanvasGroup.alpha to fade the group.
public static MotionHandle BindToAlpha(this FloatMotionBuilder builder, CanvasGroup canvasGroup)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.canvasGroupCanvasGroupTarget CanvasGroup that receives the update.- Returns
MotionHandle
public static MotionHandle BindToAlpha<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, CanvasGroup canvasGroup)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.canvasGroupCanvasGroupTarget CanvasGroup that receives the update.- Returns
MotionHandle
BindToFontSize
Schedule a tween that writes the interpolated value to FontSize on the bound target and return its MotionHandle.
public static MotionHandle BindToFontSize<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<int, TOptions>Parameters and return value
builderthis MotionBuilder<int, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
BindToText
Write interpolated text or a formatted numeric value to the text component.
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString32Bytes, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<FixedString32Bytes, TOptions>Parameters and return value
builderthis MotionBuilder<FixedString32Bytes, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString64Bytes, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<FixedString64Bytes, TOptions>Parameters and return value
builderthis MotionBuilder<FixedString64Bytes, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString128Bytes, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<FixedString128Bytes, TOptions>Parameters and return value
builderthis MotionBuilder<FixedString128Bytes, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString512Bytes, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<FixedString512Bytes, TOptions>Parameters and return value
builderthis MotionBuilder<FixedString512Bytes, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString4096Bytes, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<FixedString4096Bytes, TOptions>Parameters and return value
builderthis MotionBuilder<FixedString4096Bytes, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<int, TOptions>Parameters and return value
builderthis MotionBuilder<int, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
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>Parameters and return value
builderthis MotionBuilder<int, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.formatstringFormat string for converting the sampled value to text.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<long, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<long, TOptions>Parameters and return value
builderthis MotionBuilder<long, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
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>Parameters and return value
builderthis MotionBuilder<long, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.formatstringFormat string for converting the sampled value to text.- Returns
MotionHandle
public static MotionHandle BindToText(this FloatMotionBuilder builder, Text text)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Text text)
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<float, TOptions>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.- Returns
MotionHandle
public static MotionHandle BindToText(this FloatMotionBuilder builder, Text text, string format)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.formatstringFormat string for converting the sampled value to text.- Returns
MotionHandle
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>Parameters and return value
builderthis MotionBuilder<float, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.textTextTarget Text that receives the update.formatstringFormat string for converting the sampled value to text.- Returns
MotionHandle
MeatMotion