Created
February 19, 2018 13:07
-
-
Save kyubuns/5c0a5810cd4181e64dcb083a5068d3de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BarAnimation : MonoBehaviour | |
| { | |
| [SerializeField] private SpriteRenderer sprite; | |
| private readonly Subject<Unit> subject = new Subject<Unit>(); | |
| public void Start() | |
| { | |
| subject.Select(_ => Anime.Play(new Vector3(1.5f, 1.5f, 1.5f), new Vector3(1f, 1f, 1f), Easing.OutElastic(TimeSpan.FromSeconds(0.5f)))) | |
| .Switch() | |
| .SubscribeToLocalScale(sprite.transform) | |
| .AddTo(this); | |
| } | |
| public void OnHitBall(Ball ball) | |
| { | |
| subject.OnNext(Unit.Default); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment