/// <summary> /// 文字动画真正的结束,若真正结束,则打开箭头显示,此时才可以跳转到下一句 /// 打开箭头需满足条件1.强制时间到达,2.文字蹦字结束 /// 特别的,当首次点击文字时,文字会直接全部显示完成 /// </summary> protected virtual void CheckCanChangeToNext() { if (m_contextStep == EnumContextStep.OnlyShowEnded && m_isForceTimeEnd) { m_contextStep = EnumContextStep.End; } }
public void SendStoryStep(int id, int index, EnumContextStep step) { CScTeamBehaviour p = PacketObject.Create <CScTeamBehaviour>(); p.intParams = new int[4]; p.intParams[0] = (int)Module_Battle.FrameAction.StoryChangeStep; p.intParams[1] = id; p.intParams[2] = index; p.intParams[3] = (int)step; Send(p); }
public void SendStoryStepToServer(EnumContextStep step) { if (!storyInfo || m_lastSendStep == step) { return; } //只有队长能发送消息 if (Level.current is Level_PveTeam && (Level.current as Level_PveTeam).selfIsleader) { m_lastSendStep = step; moduleTeam.SendStoryStep(storyInfo.ID, curStoryItemIndex, step); } }
private void OnStoryStepChange(FrameData d) { int storyId = d.parameters.GetValue <int>(0); int storyIndex = d.parameters.GetValue <int>(1); EnumContextStep step = (EnumContextStep)d.parameters.GetValue <int>(2); BaseStory story = moduleStory.GetCurrentValidStory(); if (!story) { Logger.LogWarning("there is no active story...please check out data is [id = {0},index = {1} step = {2}]"); return; } story.RecvFrameData(storyId, storyIndex, step); }
/// <summary> /// 每次刷新对话前的还原操作 /// </summary> protected virtual void ResetPerStoryItem() { //每一次一段对话刷新的时候,需要重置功能的检测时间 ResetCheckFuncDic(); m_isForceTimeEnd = false; m_contextStep = EnumContextStep.Wait; m_lastSendStep = EnumContextStep.Wait; if (!string.IsNullOrEmpty(m_lastPlayVoiceName)) { AudioManager.Stop(m_lastPlayVoiceName); m_lastPlayVoiceName = string.Empty; } //child class need recovery the model state }
public void RecvFrameData(int id, int index, EnumContextStep changeToStep) { Logger.LogDetail("recv frame story data is [id: {0} index : {1} step :{2}]", id, index, changeToStep); if (!storyInfo) { Logger.LogWarning("current stoty is null,please check out."); return; } //索引对不上的时候,强行刷新当前的对话 if (curStoryItemIndex != index) { curStoryItemIndex = index; UpdatePerStoryItem(); } OnRecvFrameData(changeToStep); }
protected virtual void OnRecvFrameData(EnumContextStep changeToStep) { m_contextStep = changeToStep; }
//延迟显示文字 protected virtual void HandleDelayContext() { //Logger.LogInfo("handle delay text"); m_contextStep = EnumContextStep.Show; }
protected virtual void OnContextAnimEnd() { m_contextStep = EnumContextStep.OnlyShowEnded; CheckCanChangeToNext(); }
protected override void OnRecvFrameData(EnumContextStep changeToStep) { base.OnRecvFrameData(changeToStep); OnChangeToStoryStep(); }