public IObservable <Unit> StartFade( FadeCanvas.PanelType type, FadeType fade, float duration, bool ignoreTimeScale) { if (this.IsFading) { return((IObservable <Unit>)null); } this._fadeType = fade; FadeItem fadeItem1 = (FadeItem)null; foreach (FadeCanvas.PanelType typeKey in FadeCanvas._typeKeys) { FadeItem fadeItem2; if (this._table.TryGetValue(typeKey, out fadeItem2)) { ((Component)fadeItem2.Graphic).get_gameObject().SetActive(typeKey == type); if (((Component)fadeItem2.Graphic).get_gameObject().get_activeSelf()) { fadeItem1 = fadeItem2; } } } if (Object.op_Equality((Object)fadeItem1, (Object)null)) { return((IObservable <Unit>)null); } this._currentPanel = fadeItem1; IConnectableObservable <Unit> iconnectableObservable = (IConnectableObservable <Unit>)Observable.Publish <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => this.FadeCoroutine(duration, ignoreTimeScale)), false)); this._disposable = iconnectableObservable.Connect(); return(this._stream = (IObservable <Unit>)iconnectableObservable); }
public FadeItem GetPanel(FadeCanvas.PanelType type) { FadeItem fadeItem1 = (FadeItem)null; foreach (FadeCanvas.PanelType typeKey in FadeCanvas._typeKeys) { FadeItem fadeItem2; if (this._table.TryGetValue(typeKey, out fadeItem2)) { ((Component)fadeItem2.Graphic).get_gameObject().SetActive(typeKey == type); if (((Component)fadeItem2.Graphic).get_gameObject().get_activeSelf()) { fadeItem1 = fadeItem2; } } } return(fadeItem1); }