public void InitData(List <DialogVo> dialogList) { _dialogList = dialogList; _storyLoader = new StoryLoader(_dialogList, OnAssetLoaded); _storyLoader.PreLoadAsset(_currentIndex, OnAssetLoaded); }
public void InitBranch(List <DialogVo> dialogList) { _currentIndex = 0; _dialogList = dialogList; IsWait = true; _storyLoader = new StoryLoader(_dialogList, OnBranchLoaded); _storyLoader.PreLoadAsset(_currentIndex, OnBranchLoaded); }
private void NextStep(GameObject go) { //等待中,加载中,有分支剧情选项时 if (IsWait || _storyLoader.IsLoading || _hasSelection) { return; } //区分用户点击和自动播放调用 if (go != null) { _isUseClick = true; } if (_dialogList.Count - 1 > _currentIndex) { if (_dialogFrame.IsPlaying) { _dialogFrame.Typing(); //正在打字的时候忽略用户点击对自动播放的影响 _isUseClick = false; } else { _storyLoader.PreLoadAsset(++_currentIndex, ShowPage); } } else { if (_dialogFrame.IsPlaying) { _dialogFrame.Typing(); return; } DialogVo vo = _dialogList[_dialogList.Count - 1]; if (vo.Event != null) { OnEvent(vo.Event); } else { EndStory(); } IsWait = true; } }