小さくて綺麗なものが作りたい。
MessageForm
kyubuns / animetask Goto Github PK
View Code? Open in Web Editor NEWTask Animation Library for Unity
License: MIT License
Task Animation Library for Unity
License: MIT License
小さくて綺麗なものが作りたい。
MessageForm
await Anime.Play(
Easing.Create<InOutQuad>(beforePosition, toPosition, 0.5f),
TranslateTo.GlobalPosition(target)
);
↓
await Easing.Create<InOutQuad>(beforePosition, toPosition, 0.5f).ToGlobalPosition(target);
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%);}))
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);
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.