小さくて綺麗なものが作りたい。
MessageForm
kyubuns / animerx Goto Github PK
View Code? Open in Web Editor NEWRx Tween Animation Library for Unity
License: MIT License
Rx Tween Animation Library for Unity
License: MIT License
小さくて綺麗なものが作りたい。
MessageForm
Hello!, How can I pause/resume Tween ( IObservable )?
Hi, fantastic library, planing to replace the one we use currently with AnimeRx because of great UniRx integration. Question: is the support for "higher level" tweens like Punch or Shake planned?
This error occurred when AnimeRx importerd.
`IObservable' is an ambiguous reference between `System.IObservable<T>' and `UniRx.IObservable<T>'
Environment:
Unity 2018.1.0f2
WebGL
Scripting Runtime Version: .NET 4.x Equivalent
Api Compatibility Level: .NET 4.x
Look at the code below, It seems that Sleep did not work as expected
Anime.Play(new Vector3(-5f, 0f, 0f), new Vector3(5f, 0f, 0f), Easing.OutExpo(2f))
.Sleep(3f)
.Play(new Vector3(-5f, 0f, 0f), Easing.OutExpo(2f))
.SubscribeToPosition(cube);
it should have waited here for 1 second after the cube moved to position 5f before moving to position -5. but it will move immediately to position Vector3 (0f, 0f, 0f) and wait for 1 second here then move to position -5, by default (Vector3) returns Vector3.zero
public static IObservable<T> Sleep<T>(float duration, IScheduler scheduler)
{
return SleepInternal(duration, scheduler).Select(_ => default(T));
}
public static IObservable<T> Sleep<T>(float duration, T value, IScheduler scheduler)
{
return SleepInternal(duration, scheduler).Select(_ => default(T)).Stay(value);
}
default (T) needs to be replaced
I write it into something like:
public static IObservable<T> Sleep<T>(float duration, T value)
{
return Sleep(duration, value, DefaultScheduler);
}
public static IObservable<T> Sleep<T>(float duration, T value, IScheduler scheduler)
{
return SleepInternal(duration, scheduler).Select(_ => value);
}
*Full code
public static partial class Anime
{
public static IObservable<Unit> Sleep(float duration)
{
return Sleep(duration, DefaultScheduler);
}
public static IObservable<Unit> Sleep(float duration, IScheduler scheduler)
{
return SleepInternal(duration, scheduler);
}
public static IObservable<T> Sleep<T>(float duration, T value)
{
return Sleep(duration, value, DefaultScheduler);
}
public static IObservable<T> Sleep<T>(float duration, T value, IScheduler scheduler)
{
return SleepInternal(duration, scheduler).Select(_ => value);
}
public static IObservable<T> Sleep<T>(this IObservable<T> self, float duration)
{
return self.Select(x => self.Concat(Sleep(duration, x))).Switch();
}
public static IObservable<T> Sleep<T>(this IObservable<T> self, float duration, IScheduler scheduler)
{
return self.Select(x => self.Concat(Sleep(duration, x, scheduler))).Switch();
}
public static IObservable<T> Sleep<T>(this IObservable<T> self, float duration, T value)
{
return self.Concat(Sleep(duration, value));
}
public static IObservable<T> Sleep<T>(this IObservable<T> self, float duration, T value, IScheduler scheduler)
{
return self.Concat(Sleep(duration, value, scheduler));
}
}
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.