Created
December 21, 2016 12:46
-
-
Save mattak/ffaf6a0a11ceaa53cae9a936f305a2c8 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
using UniRx; | |
using UnityEngine; | |
namespace App.UI | |
{ | |
public class GoalSeRenderer : MonoBehaviour | |
{ | |
public AudioSource AudioSource; | |
void Start() | |
{ | |
Unidux.Subject | |
.TakeUntilDestroy(this) | |
.Where(state => state.Game.IsStateChanged()) | |
.Where(state => state.Game.Phase == GameEvent.OnGoal) | |
.Subscribe(_ => PlaySE()); | |
} | |
void PlaySE() | |
{ | |
this.AudioSource.PlayOneShot(this.AudioSource.clip); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment