protected override void OnInit(QFramework.IUIData uiData) { mData = uiData as UIStoryPanelData ?? new UIStoryPanelData(); // please add init code here var text = TxtStoryContent.text; TxtStoryContent.text = string.Empty; TxtStoryContent.DOText(text, 10.0f) .OnComplete(() => { //OpenGamePanel(); this.DoTransition <UIGamePanel>(new FadeInOut(), uiData: new UIGamePanelData() { InitLevelName = GameData.CurLevelName }); }); // 点击屏幕显示所有文字 Observable.EveryUpdate() .Where(_ => Input.GetMouseButtonUp(0) || Input.GetKey(KeyCode.H) || Input.GetKey(KeyCode.Return) || Input.GetKey(KeyCode.Space)) .Subscribe(_ => { TxtStoryContent.DOKill(); TxtStoryContent.text = text; BtnSkip.Show(); }).AddTo(this); }
protected override void RegisterUIEvent() { BtnSkip.OnClickAsObservable().Subscribe(_ => { SendMsg(new AudioSoundMsg("click")); TxtStoryContent.DOKill(); this.DoTransition <UIGamePanel>(new FadeInOut(), uiData: new UIGamePanelData() { InitLevelName = GameData.CurLevelName }); }); }