[데브루키160409 박민근] UniRx 시작하기

89

Click here to load reader

Transcript of [데브루키160409 박민근] UniRx 시작하기

PowerPoint

UniRx ()@agebreak / [email protected]

PT , http://www.slideshare.net/torisoup/uni-rx

PT

UniRx

UniRx ~ ( )

UniRx - Update() - - Hot Cold - uGUI -

UniRx - Update() - - Hot Cold - uGUI -

Update Update() Observable Awke()/Start()

Obervable

,

Obervable // // , //

Update - - , , - , Rx -

Observable 3 UpdateAsObaservable- gameObject Observable . - gameObject Destroy OnCompleted Observable.EveryUpdate- gameObject Observable - MonoBehaviour ObserveEveryValueChanged- Observable.EveryUpdate - Observable

Observable.EveryUpdate Destroy OnCompleted - UpdateAsObaservable

gameObject Null

AddTo- gameObject Dispose - OnCompleted AddTo gameObjectDestroy Dispose

UniRx - Update() - - Hot Cold - uGUI -

, Observer - - Rx Observer

- UniRx - UniRx

- UniRx - UniRx

UniRx

UniRx

, ( )

- UniRx - UniRx

//1 timerReactiveProperty //

//1 timerReactiveProperty //

CurrentTime ReactiveProperty ( , OnNext )

,

Observer - (Polling) -

- C# Event - Unity SendMessage - Rx Observable OK! !

UniRx - Update() - - Hot Cold - uGUI -

Hot / Cold Observable 2 - Hot - Cold

Hot ObservableObserver ,

Hot Observable ( )

Cold ObservableObserver Subscribe ( )Cold Observable Subscribe ,

) Cold Observable SubscribeIntervalStream 3 Subscribe - OnNext -

intervalStream

Cold InservalStream Subscribe

3 ( )intervalStream

intervalStreamintervalStream

Hot Obervable Hot - Hot Hot - IntervalStream Hot

intervalStream

PublishHot Subscribe

intervalStream

Publish

OnNext Hot (1 3 Observer )

Hot / Cold Rx - - Hot Cold - Hot Cold- Cold - Subject Hot * Subject, ReactiveProperty, Hot

()

http://qiita.com/toRisouP/items/f6088963037bfda658d3http://qiita.com/toRisouP/items/c955e36610134c05c860

UniRx - Update() - - Hot Cold - uGUI -

UniRx uGUI uGUI Model-View-00 - uGUI MVO * MVC * MVVM - Obervable ReactiveProperty , uGUI

Model-View-(Reactive)PresenterMV(R)P - Model View Presenter + UniRx- 3 Observable

ViewPresenterModelMV(R)P PresenterModel View

ViewPresenterModelMV(R)P ReactiveProperty SubscribeView xxxAsObservable SubscribeModel PresenterModel View

MV(R)P 1. Model ReactiveProperty 2. Presenter 3. Presenter Model View 4. Presenter View Observable Model ReactiveProperty Subscribe

) MMD UI MV(R)P

MV(R)P - Slider InputField - ConfigComponent

SpeechTimingSliderPresenterSpeechTimingReactiveProperty( )

OnValueChangedAsObservable() ObservableSpeechTimingInputFieldPresenterOnEndEditAsObservable()InputField ObservableViewPresenterModelConfigComponent

Model

// (ms)

ReactiveProperty

Presenter (Slider )//Model->Slider

Model View//Slider->Model View Model

Presenter (Input )

View ModelModel View

uGUI MV(R)P uGUI - uGUI - , Presenter - Presenter Model View - Presenter , - Presenter

UniRx - Update() - - Hot Cold - uGUI -

Unity Obervable - Rx

Observable -> Observable- Observable.FromCoroutine

Observable -> - StartAsCoroutine

Observable -> Observable- Observable.FromCoroutine

Observable -> - StartAsCoroutine

->Observable -

- Observable

) Observable - - -

// Subscribe// //

// Subscribe// //

OnNext

// Subscribe// //

Observable -> Observable- Observable.FromCoroutine

Observable -> - StartAsCoroutine

Observable StartAsCoroutine- OnCompleted yield return null - OnNext

- Task await Unity

Web

// //

// //

// //

Unity Obervable - - -

UniRx - Update() - - Hot Cold - uGUI -

UniRx [ ] - - Rx - - - UniRx - Observer

!.()@agebreak / [email protected]

) Animation - -

AnimationEvent

[BallThrowEvent]

UniRx

// // AnimationEvent // // 5

UniRx

// // AnimationEvent // // 5

Animation

UniRx

// // AnimationEvent // // 5

UniRx

// // AnimationEvent // // 5

UniRx

// // AnimationEvent // // 5

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // //

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // //

AnimationEvent Observable

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // //

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // //

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // // yield return

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // //

StartAsCoroutine

// AnimationEvent Subject// AnimationEvent // // //

.()@agebreak / [email protected]