UniRx 에셋 추가
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO)
|
||||
|
||||
using UnityEngine;
|
||||
using UniRx.Triggers; // for enable gameObject.EventAsObservbale()
|
||||
|
||||
namespace UniRx.Examples
|
||||
{
|
||||
public class Sample03_GameObjectAsObservable : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
// All events can subscribe by ***AsObservable if enables UniRx.Triggers
|
||||
this.OnMouseDownAsObservable()
|
||||
.SelectMany(_ => this.gameObject.UpdateAsObservable())
|
||||
.TakeUntil(this.gameObject.OnMouseUpAsObservable())
|
||||
.Select(_ => Input.mousePosition)
|
||||
.RepeatUntilDestroy(this)
|
||||
.Subscribe(x => Debug.Log(x), ()=> Debug.Log("!!!" + "complete"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user