private void FinishStoryDlg() { CancelInvoke("NextStoryItem"); m_IsStoryDlgActive = false; UIManager.Instance.HideWindowByName("StoryDlgSmall"); NGUITools.SetActive(m_StoryDlgGO, false); m_StoryDlgGO = null; m_StoryInfo = null; m_EfHeadTrans = null; if (m_RunTimeEffect != null) { Destroy(m_RunTimeEffect); } RaiseStoryDlgOverEvent(); }
private void FinishStoryDlg() { m_IsStoryDlgActive = false; NGUITools.SetActive(m_StoryDlgGO, false); if (m_StoryDlgType == StoryDlgType.Big) { TouchManager.TouchEnable = true; JoyStickInputProvider.JoyStickEnable = true; GameObject dfmUIRootGO = this.transform.parent.gameObject; if (dfmUIRootGO != null) { dfmUIRootGO.GetComponent <DFMUiRoot>().SetUIVisible(true); } } m_StoryDlgGO = null; m_StoryInfo = null; RaiseStoryDlgOverEvent(); }
//直接结束剧情对话,且不触发结束事件 public void KillStoryDlg() { CancelInvoke("NextStoryItem"); if (m_IsStoryDlgActive == true) { if (null != m_StoryDlgGO) { m_IsStoryDlgActive = false; UIManager.Instance.HideWindowByName("StoryDlgSmall"); NGUITools.SetActive(m_StoryDlgGO, false); m_StoryDlgGO = null; m_StoryInfo = null; m_EfHeadTrans = null; if (m_RunTimeEffect != null) { Destroy(m_RunTimeEffect); } } } }
public void OnTriggerStory(StoryDlgArgs arg) { if (m_IsStoryDlgActive == false) { m_StoryInfo = StoryDlgManager.Instance.GetStoryInfoByID(arg.m_StoryId); if (m_StoryInfo != null) { //Debug.LogError("===== Trigger A New Story !!! " + arg.m_IntervalTime); m_StoryId = arg.m_StoryId; m_StoryDlgType = arg.m_StoryDlgType; m_IntervalTime = arg.m_IntervalTime; m_IsStoryDlgActive = true; m_StoryDlgGO = this.gameObject; m_Count = 0; //剧情对话计数器,触发一个新的剧情时重置为0 m_StepNumber = m_StoryInfo.StoryItems.Count; StoryDlgItem item = m_StoryInfo.StoryItems[m_Count]; UpdateStoryDlg(m_StoryDlgGO.transform, item); NGUITools.SetActive(m_StoryDlgGO, true); if (m_StoryDlgType == StoryDlgType.Big) { TouchManager.TouchEnable = false; JoyStickInputProvider.JoyStickEnable = false; GameObject dfmUIRootGO = this.transform.parent.gameObject; if (dfmUIRootGO != null) { dfmUIRootGO.GetComponent <DFMUiRoot>().SetUIVisible(false); } } m_Count++; if (m_IntervalTime > 0.0f) { Invoke("NextStoryItem", m_IntervalTime); } } else { Debug.LogError("Wrong Story id = " + arg.m_StoryId); } } }
public void OnTriggerStory(StoryDlgInfo storyInfo) { StoryDlgManager.Instance.FireStoryStartMsg(); if (m_IsStoryDlgActive) { //剧情对话中途被打断,中止当前对话 KillStoryDlg(); } if (m_IsStoryDlgActive == false) { m_StoryInfo = storyInfo; if (m_StoryInfo != null) { //Debug.LogError("===== Trigger A New Story !!! " + arg.m_IntervalTime); m_StoryId = m_StoryInfo.ID; m_StoryDlgType = m_StoryInfo.DlgType; m_IsStoryDlgActive = true; m_StoryDlgGO = this.gameObject; m_Count = 0; //剧情对话计数器,触发一个新的剧情时重置为0 m_StepNumber = m_StoryInfo.StoryItems.Count; StoryDlgItem item = m_StoryInfo.StoryItems[m_Count]; UpdateStoryDlg(m_StoryDlgGO.transform, item, m_Count); NGUITools.SetActive(m_StoryDlgGO, true); ShowWordDuration = item.WordDuration; m_Count++; float RealIntervalTime = item.IntervalTime; if (m_StoryDlgType == StoryDlgType.Big) { RealIntervalTime = GetRealIntervalTime(item); } if (RealIntervalTime > 0.0f) { Invoke("NextStoryItem", RealIntervalTime); } } } }