Skip to content

Instantly share code, notes, and snippets.

@kyubuns
Last active February 23, 2021 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyubuns/885634c6aa0fbb2d318174c0ebe795d9 to your computer and use it in GitHub Desktop.
Save kyubuns/885634c6aa0fbb2d318174c0ebe795d9 to your computer and use it in GitHub Desktop.
https://github.com/kyubuns/AnimeTask 1.4.0で入ったUniRxExtensionのサンプル
var score = new ReactiveProperty<int>(0);
score
.SubscribeTask(async (x, c) =>
{
scoreCounter.text = $"{x}";
await Easing.Create<OutBounce>(Vector3.one * 2f, Vector3.one, 0.5f).ToLocalScale(scoreCounter, c);
});
while (true)
{
_score.Value++;
await UniTask.Delay(TimeSpan.FromSeconds(1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment