示例#1
0
        public static async Task PlayTo <T>(IAnimatorWithStartValue <T> animator, IValueTranslator <T> translator, IScheduler scheduler)
        {
            var awaitable = new AwaitableEnumerator();

            animator.Start(translator.Current);
            StartCoroutine(PlayCoroutine(new DummyAnimator <T>(animator), translator, awaitable, scheduler));
            await awaitable;
        }
示例#2
0
 public ConvertAnimatorWithStartValue(IAnimatorWithStartValue <T> animator, Func <T, T> func)
 {
     this.animator = animator;
     this.func     = func;
 }
示例#3
0
 public static UniTask ToMaterialPropertyFloat(this IAnimatorWithStartValue <float> animator, Renderer renderer, int nameID, CancellationToken cancellationToken  = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyFloatTranslator(renderer, nameID), scheduler, cancellationToken);
示例#4
0
 public static DebugLogAnimatorWithStartValue <T> DebugLog <T>(this IAnimatorWithStartValue <T> animator)
 {
     return(new DebugLogAnimatorWithStartValue <T>(animator));
 }
示例#5
0
 public DummyAnimator(IAnimatorWithStartValue <T> animator)
 {
     this.animator = animator;
 }
示例#6
0
 public static UniTask PlayTo <T>(IAnimatorWithStartValue <T> animator, IValueTranslator <T> translator, CancellationToken cancellationToken = default)
 {
     return(PlayTo(animator, translator, DefaultScheduler, cancellationToken));
 }
示例#7
0
 public static UniTask ToGlobalRotation(this IAnimatorWithStartValue <Quaternion> animator, Component component, CancellationToken cancellationToken   = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalRotationTranslator(component.transform), scheduler, CancellationTokenSource.CreateLinkedTokenSource(component.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#8
0
 public static UniTask ToLocalScale(this IAnimatorWithStartValue <Vector2> animator, GameObject gameObject, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleTranslator(gameObject.transform), scheduler, CancellationTokenSource.CreateLinkedTokenSource(gameObject.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#9
0
 public static UniTask ToBind <T>(this IAnimatorWithStartValue <T> animator, Func <T> getter, Action <T> setter, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new BindTranslator <T>(getter, setter), scheduler, cancellationToken, skipToken);
示例#10
0
 public RelativeDelayAnimatorWithStartValue(IAnimatorWithStartValue <T2> baseAnimator, float duration)
 {
     this.baseAnimator = baseAnimator.Start(default);
示例#11
0
 public static RelativeDelayAnimatorWithStartValue <T1, T2> RelativeDelay <T1, T2>(this IAnimatorWithStartValue <T2> baseAnimator, float duration) => new RelativeDelayAnimatorWithStartValue <T1, T2>(baseAnimator, duration);
示例#12
0
 public static ConcatAnimatorWithStartValue <T> Delay <T>(this IAnimatorWithStartValue <T> animator, float duration) => Concat(animator, Delay <T>(duration));
 public static UniTask ToAnchoredPositionX(this IAnimatorWithStartValue <float> animator, Graphic graphic, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default)
 {
     CheckAlive(graphic);
     return(Anime.PlayTo(animator, new AnchoredPositionXTranslator(graphic.rectTransform, 0), scheduler, CancellationTokenSource.CreateLinkedTokenSource(graphic.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken));
 }
 public static UniTask ToAnchoredPosition(this IAnimatorWithStartValue <Vector2> animator, RectTransform rectTransform, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default)
 {
     CheckAlive(rectTransform);
     return(Anime.PlayTo(animator, new AnchoredPositionTranslator(rectTransform), scheduler, CancellationTokenSource.CreateLinkedTokenSource(rectTransform.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken));
 }
 public static UniTask ToSizeDeltaY(this IAnimatorWithStartValue <float> animator, GameObject gameObject, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default)
 {
     CheckAlive(gameObject);
     return(Anime.PlayTo(animator, new SizeDeltaXTranslator(gameObject.GetComponent <RectTransform>(), 1), scheduler, CancellationTokenSource.CreateLinkedTokenSource(gameObject.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken));
 }
示例#16
0
 public static UniTask ToFillAmount(this IAnimatorWithStartValue <float> animator, Image image, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new FillAmountTranslator(image), scheduler, CancellationTokenSource.CreateLinkedTokenSource(image.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#17
0
 public static UniTask ToGlobalPositionZ(this IAnimatorWithStartValue <float> animator, GameObject gameObject, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new GlobalPositionXTranslator(gameObject.transform, 2), scheduler, CancellationTokenSource.CreateLinkedTokenSource(gameObject.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#18
0
 public static ConcatAnimatorWithStartValue <T> Concat <T>(this IAnimatorWithStartValue <T> animator1, params IConcatableAnimator <T>[] animator2)
 {
     return(new ConcatAnimatorWithStartValue <T>(animator1, animator2));
 }
示例#19
0
 public static UniTask ToLocalScaleZ(this IAnimatorWithStartValue <float> animator, Component component, CancellationToken cancellationToken   = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new LocalScaleXTranslator(component.transform, 2), scheduler, CancellationTokenSource.CreateLinkedTokenSource(component.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#20
0
 public ConcatAnimatorWithStartValue(IAnimatorWithStartValue <T> animator1, IConcatableAnimator <T>[] animator2)
 {
     this.animator1 = animator1;
     this.animator2 = animator2;
 }
示例#21
0
 public static UniTask ToReactiveProperty <T>(this IAnimatorWithStartValue <T> animator, ReactiveProperty <T> reactiveProperty, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ReactivePropertyTranslator <T>(reactiveProperty), scheduler, cancellationToken, skipToken);
示例#22
0
 public static UniTask ToNone <T>(this IAnimatorWithStartValue <T> animator, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default)
 {
     return(Anime.PlayTo(animator, new NoneTranslator <T>(), scheduler, cancellationToken, skipToken));
 }
示例#23
0
 public static async UniTask PlayTo <T>(IAnimatorWithStartValue <T> animator, IValueTranslator <T> translator, IScheduler scheduler, CancellationToken cancellationToken = default)
 {
     animator.Start(translator.Current);
     await PlayInternal(new DummyAnimator <T>(animator), translator, scheduler, cancellationToken);
 }
示例#24
0
 public static UniTask ToMaterialPropertyInt(this IAnimatorWithStartValue <int> animator, Renderer renderer, string name, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyIntTranslator(renderer, name), scheduler, CancellationTokenSource.CreateLinkedTokenSource(renderer.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#25
0
 public static UniTask ToColorA(this IAnimatorWithStartValue <float> animator, Graphic graphic, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorXTranslator(graphic, 3), scheduler, cancellationToken);
示例#26
0
 public static UniTask ToAnchoredPosition(this IAnimatorWithStartValue <Vector2> animator, Graphic graphic, CancellationToken cancellationToken       = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new AnchoredPositionTranslator(graphic.rectTransform), scheduler, CancellationTokenSource.CreateLinkedTokenSource(graphic.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#27
0
 public DebugLogAnimatorWithStartValue(IAnimatorWithStartValue <T> animator)
 {
     this.animator = animator;
 }
示例#28
0
 public static UniTask ToAnchoredPositionY(this IAnimatorWithStartValue <float> animator, GameObject gameObject, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new AnchoredPositionXTranslator(gameObject.GetComponent <RectTransform>(), 1), scheduler, CancellationTokenSource.CreateLinkedTokenSource(gameObject.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);
示例#29
0
 public static UniTask ToMaterialPropertyInt(this IAnimatorWithStartValue <int> animator, Renderer renderer, string name, CancellationToken cancellationToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new MaterialPropertyIntTranslator(renderer, name), scheduler, cancellationToken);
示例#30
0
 public static UniTask ToColorA(this IAnimatorWithStartValue <float> animator, Graphic graphic, CancellationToken cancellationToken = default, SkipToken skipToken = default, IScheduler scheduler = default) => Anime.PlayTo(animator, new ColorXTranslator(graphic, 3), scheduler, CancellationTokenSource.CreateLinkedTokenSource(graphic.GetCancellationTokenOnDestroy(), cancellationToken).Token, skipToken);