From cbab6de65471076b0e434d2c48f7584ddf20e1f2 Mon Sep 17 00:00:00 2001 From: kyubuns Date: Wed, 6 Jan 2021 16:37:14 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=81=93=E3=81=AE=E9=9A=9B=E3=81=A0?= =?UTF-8?q?=E3=81=8B=E3=82=89=E6=98=94=E3=81=AE=E8=A8=98=E8=BF=B0=E3=81=AF?= =?UTF-8?q?=E6=B6=88=E3=81=97=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/AnimeTask/Scripts/Anime.cs | 24 +-- .../Scripts/Translator/ActionTranslator.cs | 3 +- .../Scripts/Translator/MaterialTranslator.cs | 34 ++-- .../Scripts/Translator/ProgressTranslator.cs | 3 +- .../Scripts/Translator/TransformTranslator.cs | 178 ++++++++---------- .../Scripts/Translator/UGuiTranslator.cs | 28 ++- 6 files changed, 105 insertions(+), 165 deletions(-) diff --git a/Assets/AnimeTask/Scripts/Anime.cs b/Assets/AnimeTask/Scripts/Anime.cs index d13c65f..ee2406e 100644 --- a/Assets/AnimeTask/Scripts/Anime.cs +++ b/Assets/AnimeTask/Scripts/Anime.cs @@ -9,32 +9,12 @@ public static class Anime { public static IScheduler DefaultScheduler { get; set; } = new TimeScheduler(); - public static UniTask Play(IAnimator animator, ITranslator translator, CancellationToken cancellationToken = default) - { - return Play(animator, translator, DefaultScheduler, cancellationToken); - } - - public static UniTask Play(IAnimator animator, IProgress progress, CancellationToken cancellationToken = default) - { - return Play(animator, TranslateTo.Progress(progress), cancellationToken); - } - - public static async UniTask Play(IAnimator animator, ITranslator translator, IScheduler scheduler, CancellationToken cancellationToken = default) + public static async UniTask Play(IAnimator animator, ITranslator translator, IScheduler scheduler = default, CancellationToken cancellationToken = default) { await PlayInternal(animator, translator, scheduler, cancellationToken); } - public static UniTask Play(IAnimator animator, IProgress progress, IScheduler scheduler, CancellationToken cancellationToken = default) - { - return Play(animator, TranslateTo.Progress(progress), scheduler, cancellationToken); - } - - public static UniTask PlayTo(IAnimatorWithStartValue animator, IValueTranslator translator, CancellationToken cancellationToken = default) - { - return PlayTo(animator, translator, DefaultScheduler, cancellationToken); - } - - public static async UniTask PlayTo(IAnimatorWithStartValue animatorWithStartValue, IValueTranslator translator, IScheduler scheduler, CancellationToken cancellationToken = default) + public static async UniTask PlayTo(IAnimatorWithStartValue animatorWithStartValue, IValueTranslator translator, IScheduler scheduler = default, CancellationToken cancellationToken = default) { var animator = animatorWithStartValue.Start(translator.Current); await PlayInternal(animator, translator, scheduler, cancellationToken); diff --git a/Assets/AnimeTask/Scripts/Translator/ActionTranslator.cs b/Assets/AnimeTask/Scripts/Translator/ActionTranslator.cs index 9a8c022..95ac0d0 100644 --- a/Assets/AnimeTask/Scripts/Translator/ActionTranslator.cs +++ b/Assets/AnimeTask/Scripts/Translator/ActionTranslator.cs @@ -6,8 +6,7 @@ namespace AnimeTask { public static partial class TranslateTo { - public static ActionTranslator Action(Action action) => new ActionTranslator(action); - public static UniTask ToAction(this IAnimator animator, Action action, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, Action(action), scheduler, cancellationToken); + public static UniTask ToAction(this IAnimator animator, Action action, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ActionTranslator(action), scheduler, cancellationToken); } public class ActionTranslator : ITranslator diff --git a/Assets/AnimeTask/Scripts/Translator/MaterialTranslator.cs b/Assets/AnimeTask/Scripts/Translator/MaterialTranslator.cs index 4db1427..e8e9527 100644 --- a/Assets/AnimeTask/Scripts/Translator/MaterialTranslator.cs +++ b/Assets/AnimeTask/Scripts/Translator/MaterialTranslator.cs @@ -6,26 +6,20 @@ namespace AnimeTask { public static partial class TranslateTo { - public static MaterialPropertyColorTranslator MaterialPropertyColor(Renderer renderer, int nameID) => new MaterialPropertyColorTranslator(renderer, nameID); - public static MaterialPropertyColorTranslator MaterialPropertyColor(Renderer renderer, string name) => new MaterialPropertyColorTranslator(renderer, name); - public static UniTask ToMaterialPropertyColor(this IAnimator animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, MaterialPropertyColor(renderer, nameID), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyColor(this IAnimator animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, MaterialPropertyColor(renderer, name), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyColor(this IAnimatorWithStartValue animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, MaterialPropertyColor(renderer, nameID), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyColor(this IAnimatorWithStartValue animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, MaterialPropertyColor(renderer, name), scheduler, cancellationToken); - - public static MaterialPropertyFloatTranslator MaterialPropertyFloat(Renderer renderer, int nameID) => new MaterialPropertyFloatTranslator(renderer, nameID); - public static MaterialPropertyFloatTranslator MaterialPropertyFloat(Renderer renderer, string name) => new MaterialPropertyFloatTranslator(renderer, name); - public static UniTask ToMaterialPropertyFloat(this IAnimator animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, MaterialPropertyFloat(renderer, nameID), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyFloat(this IAnimator animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, MaterialPropertyFloat(renderer, name), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyFloat(this IAnimatorWithStartValue animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, MaterialPropertyFloat(renderer, nameID), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyFloat(this IAnimatorWithStartValue animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, MaterialPropertyFloat(renderer, name), scheduler, cancellationToken); - - public static MaterialPropertyIntTranslator MaterialPropertyInt(Renderer renderer, int nameID) => new MaterialPropertyIntTranslator(renderer, nameID); - public static MaterialPropertyIntTranslator MaterialPropertyInt(Renderer renderer, string name) => new MaterialPropertyIntTranslator(renderer, name); - public static UniTask ToMaterialPropertyInt(this IAnimator animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, MaterialPropertyInt(renderer, nameID), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyInt(this IAnimator animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, MaterialPropertyInt(renderer, name), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyInt(this IAnimatorWithStartValue animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, MaterialPropertyInt(renderer, nameID), scheduler, cancellationToken); - public static UniTask ToMaterialPropertyInt(this IAnimatorWithStartValue animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, MaterialPropertyInt(renderer, name), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyColor(this IAnimator animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new MaterialPropertyColorTranslator(renderer, nameID), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyColor(this IAnimator animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new MaterialPropertyColorTranslator(renderer, name), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyColor(this IAnimatorWithStartValue animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyColorTranslator(renderer, nameID), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyColor(this IAnimatorWithStartValue animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyColorTranslator(renderer, name), scheduler, cancellationToken); + + public static UniTask ToMaterialPropertyFloat(this IAnimator animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new MaterialPropertyFloatTranslator(renderer, nameID), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyFloat(this IAnimator animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new MaterialPropertyFloatTranslator(renderer, name), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyFloat(this IAnimatorWithStartValue animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyFloatTranslator(renderer, nameID), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyFloat(this IAnimatorWithStartValue animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyFloatTranslator(renderer, name), scheduler, cancellationToken); + + public static UniTask ToMaterialPropertyInt(this IAnimator animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new MaterialPropertyIntTranslator(renderer, nameID), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyInt(this IAnimator animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new MaterialPropertyIntTranslator(renderer, name), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyInt(this IAnimatorWithStartValue animator, Renderer renderer, int nameID, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyIntTranslator(renderer, nameID), scheduler, cancellationToken); + public static UniTask ToMaterialPropertyInt(this IAnimatorWithStartValue animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyIntTranslator(renderer, name), scheduler, cancellationToken); } public class MaterialPropertyColorTranslator : IValueTranslator diff --git a/Assets/AnimeTask/Scripts/Translator/ProgressTranslator.cs b/Assets/AnimeTask/Scripts/Translator/ProgressTranslator.cs index 90d635d..9070e05 100644 --- a/Assets/AnimeTask/Scripts/Translator/ProgressTranslator.cs +++ b/Assets/AnimeTask/Scripts/Translator/ProgressTranslator.cs @@ -6,8 +6,7 @@ namespace AnimeTask { public static partial class TranslateTo { - public static ProgressTranslator Progress(IProgress progress) => new ProgressTranslator(progress); - public static UniTask ToProgress(this IAnimator animator, IProgress progress, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, Progress(progress), scheduler, cancellationToken); + public static UniTask ToProgress(this IAnimator animator, IProgress progress, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ProgressTranslator(progress), scheduler, cancellationToken); } public class ProgressTranslator : ITranslator diff --git a/Assets/AnimeTask/Scripts/Translator/TransformTranslator.cs b/Assets/AnimeTask/Scripts/Translator/TransformTranslator.cs index 63e13d1..6642b1c 100644 --- a/Assets/AnimeTask/Scripts/Translator/TransformTranslator.cs +++ b/Assets/AnimeTask/Scripts/Translator/TransformTranslator.cs @@ -6,108 +6,82 @@ namespace AnimeTask { public static partial class TranslateTo { - public static LocalPositionTranslator LocalPosition(GameObject gameObject) => new LocalPositionTranslator(gameObject.transform); - public static LocalPositionTranslator LocalPosition(Component component) => new LocalPositionTranslator(component.transform); - public static UniTask ToLocalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPosition(component), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPosition(component), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPosition(component), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPosition(component), scheduler, cancellationToken); - - public static LocalPositionXTranslator LocalPositionX(GameObject gameObject) => new LocalPositionXTranslator(gameObject.transform, 0); - public static LocalPositionXTranslator LocalPositionX(Component component) => new LocalPositionXTranslator(component.transform, 0); - public static UniTask ToLocalPositionX(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPositionX(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPositionX(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPositionX(component), scheduler, cancellationToken); - public static UniTask ToLocalPositionX(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPositionX(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPositionX(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPositionX(component), scheduler, cancellationToken); - - public static LocalPositionXTranslator LocalPositionY(GameObject gameObject) => new LocalPositionXTranslator(gameObject.transform, 1); - public static LocalPositionXTranslator LocalPositionY(Component component) => new LocalPositionXTranslator(component.transform, 1); - public static UniTask ToLocalPositionY(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPositionY(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPositionY(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPositionY(component), scheduler, cancellationToken); - public static UniTask ToLocalPositionY(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPositionY(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPositionY(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPositionY(component), scheduler, cancellationToken); - - public static LocalPositionXTranslator LocalPositionZ(GameObject gameObject) => new LocalPositionXTranslator(gameObject.transform, 2); - public static LocalPositionXTranslator LocalPositionZ(Component component) => new LocalPositionXTranslator(component.transform, 2); - public static UniTask ToLocalPositionZ(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPositionZ(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPositionZ(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalPositionZ(component), scheduler, cancellationToken); - public static UniTask ToLocalPositionZ(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPositionZ(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalPositionZ(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalPositionZ(component), scheduler, cancellationToken); - - public static GlobalPositionTranslator GlobalPosition(GameObject gameObject) => new GlobalPositionTranslator(gameObject.transform); - public static GlobalPositionTranslator GlobalPosition(Component component) => new GlobalPositionTranslator(component.transform); - public static UniTask ToGlobalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPosition(component), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPosition(component), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPosition(component), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPosition(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPosition(component), scheduler, cancellationToken); - - public static GlobalPositionXTranslator GlobalPositionX(GameObject gameObject) => new GlobalPositionXTranslator(gameObject.transform, 0); - public static GlobalPositionXTranslator GlobalPositionX(Component component) => new GlobalPositionXTranslator(component.transform, 0); - public static UniTask ToGlobalPositionX(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPositionX(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPositionX(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPositionX(component), scheduler, cancellationToken); - public static UniTask ToGlobalPositionX(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPositionX(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPositionX(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPositionX(component), scheduler, cancellationToken); - - public static GlobalPositionXTranslator GlobalPositionY(GameObject gameObject) => new GlobalPositionXTranslator(gameObject.transform, 1); - public static GlobalPositionXTranslator GlobalPositionY(Component component) => new GlobalPositionXTranslator(component.transform, 1); - public static UniTask ToGlobalPositionY(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPositionY(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPositionY(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPositionY(component), scheduler, cancellationToken); - public static UniTask ToGlobalPositionY(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPositionY(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPositionY(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPositionY(component), scheduler, cancellationToken); - - public static GlobalPositionXTranslator GlobalPositionZ(GameObject gameObject) => new GlobalPositionXTranslator(gameObject.transform, 2); - public static GlobalPositionXTranslator GlobalPositionZ(Component component) => new GlobalPositionXTranslator(component.transform, 2); - public static UniTask ToGlobalPositionZ(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPositionZ(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPositionZ(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalPositionZ(component), scheduler, cancellationToken); - public static UniTask ToGlobalPositionZ(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPositionZ(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalPositionZ(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalPositionZ(component), scheduler, cancellationToken); - - public static LocalScaleTranslator LocalScale(GameObject gameObject) => new LocalScaleTranslator(gameObject.transform); - public static LocalScaleTranslator LocalScale(Component component) => new LocalScaleTranslator(component.transform); - public static UniTask ToLocalScale(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScale(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScale(component), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScale(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScale(component), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScale(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScale(component), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScale(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScale(component), scheduler, cancellationToken); - - public static LocalScaleXTranslator LocalScaleX(GameObject gameObject) => new LocalScaleXTranslator(gameObject.transform, 0); - public static LocalScaleXTranslator LocalScaleX(Component component) => new LocalScaleXTranslator(component.transform, 0); - public static UniTask ToLocalScaleX(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScaleX(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScaleX(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScaleX(component), scheduler, cancellationToken); - public static UniTask ToLocalScaleX(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScaleX(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScaleX(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScaleX(component), scheduler, cancellationToken); - - public static LocalScaleXTranslator LocalScaleY(GameObject gameObject) => new LocalScaleXTranslator(gameObject.transform, 1); - public static LocalScaleXTranslator LocalScaleY(Component component) => new LocalScaleXTranslator(component.transform, 1); - public static UniTask ToLocalScaleY(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScaleY(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScaleY(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScaleY(component), scheduler, cancellationToken); - public static UniTask ToLocalScaleY(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScaleY(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScaleY(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScaleY(component), scheduler, cancellationToken); - - public static LocalScaleXTranslator LocalScaleZ(GameObject gameObject) => new LocalScaleXTranslator(gameObject.transform, 2); - public static LocalScaleXTranslator LocalScaleZ(Component component) => new LocalScaleXTranslator(component.transform, 2); - public static UniTask ToLocalScaleZ(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScaleZ(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScaleZ(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, LocalScaleZ(component), scheduler, cancellationToken); - public static UniTask ToLocalScaleZ(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScaleZ(gameObject), scheduler, cancellationToken); - public static UniTask ToLocalScaleZ(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, LocalScaleZ(component), scheduler, cancellationToken); - - public static GlobalRotationTranslator GlobalRotation(GameObject gameObject) => new GlobalRotationTranslator(gameObject.transform); - public static GlobalRotationTranslator GlobalRotation(Component component) => new GlobalRotationTranslator(component.transform); - public static UniTask ToGlobalRotation(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalRotation(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalRotation(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, GlobalRotation(component), scheduler, cancellationToken); - public static UniTask ToGlobalRotation(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalRotation(gameObject), scheduler, cancellationToken); - public static UniTask ToGlobalRotation(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, GlobalRotation(component), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionTranslator(component.transform), scheduler, cancellationToken); + + public static UniTask ToLocalPositionX(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionXTranslator(gameObject.transform, 0), scheduler, cancellationToken); + public static UniTask ToLocalPositionX(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionXTranslator(component.transform, 0), scheduler, cancellationToken); + public static UniTask ToLocalPositionX(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionXTranslator(gameObject.transform, 0), scheduler, cancellationToken); + public static UniTask ToLocalPositionX(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionXTranslator(component.transform, 0), scheduler, cancellationToken); + + public static UniTask ToLocalPositionY(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionXTranslator(gameObject.transform, 1), scheduler, cancellationToken); + public static UniTask ToLocalPositionY(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionXTranslator(component.transform, 1), scheduler, cancellationToken); + public static UniTask ToLocalPositionY(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionXTranslator(gameObject.transform, 1), scheduler, cancellationToken); + public static UniTask ToLocalPositionY(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionXTranslator(component.transform, 1), scheduler, cancellationToken); + + public static UniTask ToLocalPositionZ(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionXTranslator(gameObject.transform, 2), scheduler, cancellationToken); + public static UniTask ToLocalPositionZ(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalPositionXTranslator(component.transform, 2), scheduler, cancellationToken); + public static UniTask ToLocalPositionZ(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionXTranslator(gameObject.transform, 2), scheduler, cancellationToken); + public static UniTask ToLocalPositionZ(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalPositionXTranslator(component.transform, 2), scheduler, cancellationToken); + + public static UniTask ToGlobalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToGlobalPosition(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionTranslator(component.transform), scheduler, cancellationToken); + + public static UniTask ToGlobalPositionX(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionXTranslator(gameObject.transform, 0), scheduler, cancellationToken); + public static UniTask ToGlobalPositionX(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionXTranslator(component.transform, 0), scheduler, cancellationToken); + public static UniTask ToGlobalPositionX(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(gameObject.transform, 0), scheduler, cancellationToken); + public static UniTask ToGlobalPositionX(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(component.transform, 0), scheduler, cancellationToken); + + public static UniTask ToGlobalPositionY(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionXTranslator(gameObject.transform, 1), scheduler, cancellationToken); + public static UniTask ToGlobalPositionY(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionXTranslator(component.transform, 1), scheduler, cancellationToken); + public static UniTask ToGlobalPositionY(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(gameObject.transform, 1), scheduler, cancellationToken); + public static UniTask ToGlobalPositionY(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(component.transform, 1), scheduler, cancellationToken); + + public static UniTask ToGlobalPositionZ(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionXTranslator(gameObject.transform, 2), scheduler, cancellationToken); + public static UniTask ToGlobalPositionZ(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalPositionXTranslator(component.transform, 2), scheduler, cancellationToken); + public static UniTask ToGlobalPositionZ(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(gameObject.transform, 2), scheduler, cancellationToken); + public static UniTask ToGlobalPositionZ(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(component.transform, 2), scheduler, cancellationToken); + + public static UniTask ToLocalScale(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToLocalScale(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleTranslator(component.transform), scheduler, cancellationToken); + + public static UniTask ToLocalScaleX(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleXTranslator(gameObject.transform, 0), scheduler, cancellationToken); + public static UniTask ToLocalScaleX(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleXTranslator(component.transform, 0), scheduler, cancellationToken); + public static UniTask ToLocalScaleX(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(gameObject.transform, 0), scheduler, cancellationToken); + public static UniTask ToLocalScaleX(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(component.transform, 0), scheduler, cancellationToken); + + public static UniTask ToLocalScaleY(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleXTranslator(gameObject.transform, 1), scheduler, cancellationToken); + public static UniTask ToLocalScaleY(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleXTranslator(component.transform, 1), scheduler, cancellationToken); + public static UniTask ToLocalScaleY(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(gameObject.transform, 1), scheduler, cancellationToken); + public static UniTask ToLocalScaleY(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(component.transform, 1), scheduler, cancellationToken); + + public static UniTask ToLocalScaleZ(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleXTranslator(gameObject.transform, 2), scheduler, cancellationToken); + public static UniTask ToLocalScaleZ(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new LocalScaleXTranslator(component.transform, 2), scheduler, cancellationToken); + public static UniTask ToLocalScaleZ(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(gameObject.transform, 2), scheduler, cancellationToken); + public static UniTask ToLocalScaleZ(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(component.transform, 2), scheduler, cancellationToken); + + public static UniTask ToGlobalRotation(this IAnimator animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalRotationTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToGlobalRotation(this IAnimator animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new GlobalRotationTranslator(component.transform), scheduler, cancellationToken); + public static UniTask ToGlobalRotation(this IAnimatorWithStartValue animator, GameObject gameObject, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalRotationTranslator(gameObject.transform), scheduler, cancellationToken); + public static UniTask ToGlobalRotation(this IAnimatorWithStartValue animator, Component component, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalRotationTranslator(component.transform), scheduler, cancellationToken); } public class LocalPositionTranslator : IValueTranslator, IValueTranslator diff --git a/Assets/AnimeTask/Scripts/Translator/UGuiTranslator.cs b/Assets/AnimeTask/Scripts/Translator/UGuiTranslator.cs index 206a563..1195947 100644 --- a/Assets/AnimeTask/Scripts/Translator/UGuiTranslator.cs +++ b/Assets/AnimeTask/Scripts/Translator/UGuiTranslator.cs @@ -7,28 +7,22 @@ namespace AnimeTask { public static partial class TranslateTo { - public static TextTranslator Text(Text text, string format) => new TextTranslator(text, format); - public static UniTask ToText(this IAnimator animator, Text text, string format, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, Text(text, format), scheduler, cancellationToken); + public static UniTask ToText(this IAnimator animator, Text text, string format, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new TextTranslator(text, format), scheduler, cancellationToken); - public static ColorTranslator Color(Graphic graphic) => new ColorTranslator(graphic); - public static UniTask ToColor(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, Color(graphic), scheduler, cancellationToken); - public static UniTask ToColor(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, Color(graphic), scheduler, cancellationToken); + public static UniTask ToColor(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ColorTranslator(graphic), scheduler, cancellationToken); + public static UniTask ToColor(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorTranslator(graphic), scheduler, cancellationToken); - public static ColorXTranslator ColorR(Graphic graphic) => new ColorXTranslator(graphic, 0); - public static UniTask ToColorR(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, ColorR(graphic), scheduler, cancellationToken); - public static UniTask ToColorR(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, ColorR(graphic), scheduler, cancellationToken); + public static UniTask ToColorR(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ColorXTranslator(graphic, 0), scheduler, cancellationToken); + public static UniTask ToColorR(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorXTranslator(graphic, 0), scheduler, cancellationToken); - public static ColorXTranslator ColorG(Graphic graphic) => new ColorXTranslator(graphic, 1); - public static UniTask ToColorG(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, ColorG(graphic), scheduler, cancellationToken); - public static UniTask ToColorG(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, ColorG(graphic), scheduler, cancellationToken); + public static UniTask ToColorG(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ColorXTranslator(graphic, 1), scheduler, cancellationToken); + public static UniTask ToColorG(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorXTranslator(graphic, 1), scheduler, cancellationToken); - public static ColorXTranslator ColorB(Graphic graphic) => new ColorXTranslator(graphic, 2); - public static UniTask ToColorB(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, ColorB(graphic), scheduler, cancellationToken); - public static UniTask ToColorB(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, ColorB(graphic), scheduler, cancellationToken); + public static UniTask ToColorB(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ColorXTranslator(graphic, 2), scheduler, cancellationToken); + public static UniTask ToColorB(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorXTranslator(graphic, 2), scheduler, cancellationToken); - public static ColorXTranslator ColorA(Graphic graphic) => new ColorXTranslator(graphic, 3); - public static UniTask ToColorA(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, ColorA(graphic), scheduler, cancellationToken); - public static UniTask ToColorA(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, ColorA(graphic), scheduler, cancellationToken); + public static UniTask ToColorA(this IAnimator animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.Play(animator, new ColorXTranslator(graphic, 3), scheduler, cancellationToken); + public static UniTask ToColorA(this IAnimatorWithStartValue animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorXTranslator(graphic, 3), scheduler, cancellationToken); } public class TextTranslator : ITranslator