public void Close() { this._canvasGroup.set_interactable(false); if (this._subscriber != null) { this._subscriber.Dispose(); } this._subscriber = ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.EaseInQuint(0.3f, true), true), (Action <M0>)(x => this._canvasGroup.set_alpha(1f - ((TimeInterval <float>) ref x).get_Value())), (Action <Exception>)(ex => Debug.LogException(ex)), (Action)(() => { this._canvasGroup.set_blocksRaycasts(false); Action onClosed = this.OnClosed; if (onClosed == null) { return; } onClosed(); })); this._count = 0; }
void OnGUI() { if (GUILayout.Button("Linear")) { MoveStart(ObservableEasing.Linear(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.linear)); } if (GUILayout.Button("EaseInSine")) { MoveStart(ObservableEasing.EaseInSine(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInSine)); } if (GUILayout.Button("EaseOutSine")) { MoveStart(ObservableEasing.EaseOutSine(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutSine)); } if (GUILayout.Button("EaseInOutSine")) { MoveStart(ObservableEasing.EaseInOutSine(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutSine)); } if (GUILayout.Button("EaseInQuad")) { MoveStart(ObservableEasing.EaseInQuad(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInQuad)); } if (GUILayout.Button("EaseOutQuad")) { MoveStart(ObservableEasing.EaseOutQuad(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutQuad)); } if (GUILayout.Button("EaseInOutQuad")) { MoveStart(ObservableEasing.EaseInOutQuad(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutQuad)); } if (GUILayout.Button("EaseInCubic")) { MoveStart(ObservableEasing.EaseInCubic(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInCubic)); } if (GUILayout.Button("EaseOutCubic")) { MoveStart(ObservableEasing.EaseOutCubic(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutCubic)); } if (GUILayout.Button("EaseInOutCubic")) { MoveStart(ObservableEasing.EaseInOutCubic(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutCubic)); } if (GUILayout.Button("EaseInQuart")) { MoveStart(ObservableEasing.EaseInQuart(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInQuart)); } if (GUILayout.Button("EaseOutQuart")) { MoveStart(ObservableEasing.EaseOutQuart(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutQuart)); } if (GUILayout.Button("EaseInOutQuart")) { MoveStart(ObservableEasing.EaseInOutQuart(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutQuart)); } if (GUILayout.Button("EaseInQuint")) { MoveStart(ObservableEasing.EaseInQuint(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInQuint)); } if (GUILayout.Button("EaseOutQuint")) { MoveStart(ObservableEasing.EaseOutQuint(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutQuint)); } if (GUILayout.Button("EaseInOutQuint")) { MoveStart(ObservableEasing.EaseInOutQuint(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutQuint)); } if (GUILayout.Button("EaseInExpo")) { MoveStart(ObservableEasing.EaseInExpo(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInExpo)); } if (GUILayout.Button("EaseOutExpo")) { MoveStart(ObservableEasing.EaseOutExpo(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutExpo)); } if (GUILayout.Button("EaseInOutExpo")) { MoveStart(ObservableEasing.EaseInOutExpo(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutExpo)); } if (GUILayout.Button("EaseInCirc")) { MoveStart(ObservableEasing.EaseInCirc(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInCirc)); } if (GUILayout.Button("EaseOutCirc")) { MoveStart(ObservableEasing.EaseOutCirc(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutCirc)); } if (GUILayout.Button("EaseInOutCirc")) { MoveStart(ObservableEasing.EaseInOutCirc(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutCirc)); } if (GUILayout.Button("EaseInBack")) { MoveStart(ObservableEasing.EaseInBack(1.0f)); //DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInBack)); DrawGraphYellow(DoTweenObservable(Ease.InBack)); } if (GUILayout.Button("EaseOutBack")) { MoveStart(ObservableEasing.EaseOutBack(1.0f)); //DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutBack)); DrawGraphYellow(DoTweenObservable(Ease.OutBack)); } if (GUILayout.Button("EaseInOutBack")) { MoveStart(ObservableEasing.EaseInOutBack(1.0f)); //DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutBack)); DrawGraphYellow(DoTweenObservable(Ease.InOutBack)); } if (GUILayout.Button("EaseInElastic")) { MoveStart(ObservableEasing.EaseInElastic(1.0f)); //DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInElastic)); DrawGraphYellow(DoTweenObservable(Ease.InElastic)); } if (GUILayout.Button("EaseOutElastic")) { MoveStart(ObservableEasing.EaseOutElastic(1.0f)); //DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutElastic)); DrawGraphYellow(DoTweenObservable(Ease.OutElastic)); } if (GUILayout.Button("EaseInOutElastic")) { MoveStart(ObservableEasing.EaseInOutElastic(1.0f)); //DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutElastic)); DrawGraphYellow(DoTweenObservable(Ease.InOutElastic)); } if (GUILayout.Button("EaseInBounce")) { MoveStart(ObservableEasing.EaseInBounce(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInBounce)); } if (GUILayout.Button("EaseOutBounce")) { MoveStart(ObservableEasing.EaseOutBounce(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeOutBounce)); } if (GUILayout.Button("EaseInOutBounce")) { MoveStart(ObservableEasing.EaseInOutBounce(1.0f)); DrawGraphBlue(LeanTweenObservable(LeanTweenType.easeInOutBounce)); } if (GUILayout.Button("ShowAvgResult")) { UnityEngine.Debug.Log("Avg:" + stopList.Where(x => x > 3.0f).Average()); } if (GUILayout.Button("ReMotion")) { InitPerf(); Observable.NextFrame().Subscribe(____ => { var sw = System.Diagnostics.Stopwatch.StartNew(); foreach (var xxx in testObjects) { xxx.transform.TweenPosition(new Vector3(10, 10, 10), 3.0f, EasingFunctions.Linear); } sw.Stop(); UnityEngine.Debug.Log("ReMotion Initial:" + sw.Elapsed.TotalMilliseconds + "ms"); Observable.TimerFrame(3).Subscribe(__ => startStopwatch = true); }); } if (GUILayout.Button("DOTween")) { InitPerf(); Observable.NextFrame().Subscribe(____ => { var sw = System.Diagnostics.Stopwatch.StartNew(); foreach (var xxx in testObjects) { xxx.transform.DOMove(new Vector3(10, 10, 10), 3f).SetEase(Ease.Linear); } sw.Stop(); UnityEngine.Debug.Log("DOTween Initial:" + sw.Elapsed.TotalMilliseconds + "ms"); Observable.TimerFrame(3).Subscribe(__ => startStopwatch = true); }); } if (GUILayout.Button("LeanTween")) { InitPerf(); Observable.NextFrame().Subscribe(____ => { var sw = System.Diagnostics.Stopwatch.StartNew(); foreach (var xxx in testObjects) { LeanTween.move(xxx, new Vector3(10, 10, 10), 3.0f).setEase(LeanTweenType.linear); } sw.Stop(); UnityEngine.Debug.Log("LeanTween Initial:" + sw.Elapsed.TotalMilliseconds + "ms"); Observable.TimerFrame(3).Subscribe(__ => startStopwatch = true); }); } if (GUILayout.Button("iTween")) { InitPerf(); Observable.NextFrame().Subscribe(____ => { var sw = System.Diagnostics.Stopwatch.StartNew(); foreach (var xxx in testObjects) { iTween.MoveTo(xxx, new Vector3(10f, 10f, 10f), 3.0f); } sw.Stop(); UnityEngine.Debug.Log("iTween Initial:" + sw.Elapsed.TotalMilliseconds + "ms"); Observable.TimerFrame(3).Subscribe(__ => startStopwatch = true); }); } if (GUILayout.Button("Uween")) { InitPerf(); Observable.NextFrame().Subscribe(____ => { var sw = System.Diagnostics.Stopwatch.StartNew(); foreach (var xxx in testObjects) { Uween.TweenXYZ.Add(xxx, 3.0f, new Vector3(10, 10, 10)); } sw.Stop(); UnityEngine.Debug.Log("Uween Initial:" + sw.Elapsed.TotalMilliseconds + "ms"); Observable.TimerFrame(3).Subscribe(__ => startStopwatch = true); }); } }
private IConnectableObservable <TimeInterval <float> > GetObservableEasing( ResultMessageElement.FadeType _fadeType, float _duration) { switch (_fadeType) { case ResultMessageElement.FadeType.Linear: return((IConnectableObservable <TimeInterval <float> >)Observable.Publish <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>(Observable.TakeUntilDisable <float>((IObservable <M0>)ObservableEasing.Linear(_duration, true), ((Component)this).get_gameObject()), false))); case ResultMessageElement.FadeType.EaseOutQuint: return((IConnectableObservable <TimeInterval <float> >)Observable.Publish <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>(Observable.TakeUntilDisable <float>((IObservable <M0>)ObservableEasing.EaseOutQuint(_duration, true), ((Component)this).get_gameObject()), false))); case ResultMessageElement.FadeType.EaseInQuint: return((IConnectableObservable <TimeInterval <float> >)Observable.Publish <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>(Observable.TakeUntilDisable <float>((IObservable <M0>)ObservableEasing.EaseInQuint(_duration, true), ((Component)this).get_gameObject()), false))); default: return((IConnectableObservable <TimeInterval <float> >)null); } }