Test UniRx 00

Unity3D/UniRX 2019. 1. 18. 11:23
반응형

UniRX (Reactive Extension for Unity)

What is React?

ReactiveX

반응형 프로그래밍 (Reactive Prigramming)

* 비동기 데이터 흐름 (data flow)에 기반을 둔 프로그래밍 패러다임. 데이터흐름은 마치 강과 같아서 이를 관찰하거나 필터링 하거나 다룰수 있으며 새로운 사용자를 위한 새로운 흐름을 만들기 위해 다른 흐름과 병합 할수도 있다.


#데이터 흐름 #필터링 #병합 


참고: https://brunch.co.kr/@yudong/33



참고자료 : 

https://www.slideshare.net/agebreak/160402-unirx

https://www.slideshare.net/agebreak/unite17-unirx

https://github.com/neuecc/UniRx/tree/master/Assets/Plugins/UniRx/Examples

https://github.com/neuecc/UniRx

https://en.wikipedia.org/wiki/Reactive_programming



예제 

유니티 2018.3 / .NET 4.6 

https://qiita.com/toRisouP/items/30c576c7b0a99f41fb87

https://qiita.com/toRisouP/items/596e42fac1b02f59f271



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
using UniRx.Triggers;
using System.Threading.Tasks;
using System;
 
public class TestInputMain : MonoBehaviour
{
    public UIButton btnLeft;
    public UIButton btnRight;
 
    /*
     * start
     * 1
     * end
     * 2
     * 3
     * 4
     */
    void Start()
    {
        Debug.Log("start");
 
        Wait();
 
        Debug.Log("end");
    }
 
    private async Task Wait() {
        Debug.Log("1");
        await Task.Delay(TimeSpan.FromSeconds(1));
        Debug.Log("2");
        await Observable.Timer(TimeSpan.FromSeconds(1));
        Debug.Log("3");
        await Observable.TimerFrame(3);
        Debug.Log("4");
    }
}
 
cs


반응형

'Unity3D > UniRX' 카테고리의 다른 글

Test UniRx 01  (0) 2019.01.18
: