Giter Site home page Giter Site logo

animetask's Introduction

小さくて綺麗なものが作りたい。
MessageForm

animetask's People

Contributors

adarapata avatar c3-hoge-fuga-piyo avatar kyubuns avatar toddlerer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animetask's Issues

Support for IProgress

Hi,

would it be possible to add animation progress support via IProgress interface? Progress would be normalized value (0..1), used like so:

await anime.Play([animation], Progress.Create<float>(x => { if (x > .05f) Debug.Log("After 50%);}))

New syntax

Before

await Anime.Play(
    Easing.Create<InOutQuad>(beforePosition, toPosition, 0.5f),
    TranslateTo.GlobalPosition(target)
);

After

await Easing.Create<InOutQuad>(beforePosition, toPosition, 0.5f).ToGlobalPosition(target);

A to B to A on Single Animator

Sample
https://twitter.com/kyubuns/status/1276883255023681536

Anime.Play(
    new Vector3EasingAnimatorMid(
        new InOutCirc(),
        new Vector3(0f, 0f, 0f),
        new Vector3(2.5f, 2.5f, 2.5f),
        new Vector3(0f, 0f, 0f),
    duration),
    TranslateTo.LocalScale(discObject)
)
public class Vector3EasingAnimatorMid : IAnimator<Vector3>
{
    private readonly IEasing easing;
    private readonly Vector3 start;
    private readonly Vector3 mid;
    private readonly Vector3 end;
    private readonly float duration;

    public Vector3EasingAnimatorMid(IEasing easing, Vector3 start, Vector3 mid, Vector3 end, float duration)
    {
        this.easing = easing;
        this.start = start;
        this.mid = mid;
        this.end = end;
        this.duration = duration;
    }

    public void Start()
    {
    }

    public Tuple<Vector3, bool> Update(float time)
    {
        var t = Mathf.Min(time / duration, 1f);
        if (t < 0.5f)
        {
            t = t * 2f;
            return Tuple.Create(Vector3.LerpUnclamped(start, mid, easing.Function(t)), time > (double) duration);
        }
        else
        {
            t = (t - 0.5f) * 2f;
            return Tuple.Create(Vector3.LerpUnclamped(mid, end, easing.Function(t)), time > (double) duration);
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.