/// <summary> /// 一句话说完的回调 /// </summary> private void StoryDialogOverCallback(bool noMoreNext) { ThrowCustomEvent(m_nDialogID++); if (!noMoreNext) { StoryDialogLogic.ShowStory(m_nClientStoryID, m_nDialogID, StoryDialogOverCallback, m_nDialogType); } else { Finish(); } }
void OnDisable() { if (m_IsLastDialogOpen) { m_IsLastDialogOpen = false; Singleton <ObjManager> .GetInstance().MainPlayer.IsInDialog = false; } m_Instance = null; m_StoryDialogBottom.SetActive(false); m_StoryDialogTop.SetActive(false); m_StoryDialogAsync.SetActive(false); m_StoryDialogMovieDn.gameObject.SetActive(false); m_StoryDialogMovieUp.gameObject.SetActive(false); }
// void Awake() // { // m_Instance = this; // } void OnEnable() { if (!m_IsLastDialogOpen) { m_IsLastDialogOpen = true; Singleton <ObjManager> .GetInstance().MainPlayer.IsInDialog = true; } m_Instance = this; m_StoryDialogBottom.SetActive(false); m_StoryDialogTop.SetActive(false); m_StoryDialogAsync.SetActive(false); m_StoryDialogMovieDn.gameObject.SetActive(false); m_StoryDialogMovieUp.gameObject.SetActive(false); InitBackgroundWidth(); }
void DoShowNPCDialog(int nDialogID) { // 先清理 CleanUp(); Tab_NpcDialog DialogLine = TableManager.GetNpcDialogByID(nDialogID, 0); if (DialogLine != null) { m_MissionInfoAward.SetActive(false); m_AcceptButton.SetActive(false); m_CompleteButton.SetActive(false); m_NoAcceptButton.SetActive(false); UIManager.CloseUI(UIInfo.MissionInfoController); StoryDialogLogic.ShowMissionStory(StrDictionary.GetClientString_WithNameSex(DialogLine.Dialog), true, true); } GameManager.gameManager.SoundManager.PlaySoundEffect(128); }
static void ReliveCloseOtherSubUI() { // 关闭所有PopUI List <string> uiKeyList = new List <string>(); foreach (KeyValuePair <string, GameObject> pair in m_instance.m_dicPopUI) { uiKeyList.Add(pair.Key); } for (int i = 0; i < uiKeyList.Count; i++) { m_instance.ClosePopUI(uiKeyList[i]); } uiKeyList.Clear(); // 关闭所有MenuPopUI foreach (KeyValuePair <string, GameObject> pair in m_instance.m_dicMenuPopUI) { uiKeyList.Add(pair.Key); } for (int i = 0; i < uiKeyList.Count; i++) { m_instance.CloseMenuPopUI(uiKeyList[i]); } uiKeyList.Clear(); // 关闭所有TipUI foreach (KeyValuePair <string, GameObject> pair in m_instance.m_dicTipUI) { uiKeyList.Add(pair.Key); } for (int i = 0; i < uiKeyList.Count; i++) { m_instance.CloseTipUI(uiKeyList[i]); } uiKeyList.Clear(); // 关闭所有除CentreNotice以外的MessageUI MessageUIRoot节点保留不隐藏 foreach (KeyValuePair <string, GameObject> pair in m_instance.m_dicMessageUI) { if (!pair.Key.Contains("CentreNotice")) { uiKeyList.Add(pair.Key); } } for (int i = 0; i < uiKeyList.Count; i++) { m_instance.CloseMessageUI(uiKeyList[i]); } uiKeyList.Clear(); // 中断剧情对话 if (StoryDialogLogic.Instance() != null) { CloseUI(UIInfo.StoryDialogRoot); } // 中断诗词对话 if (ShiCiLogic.Instance() != null) { CloseUI(UIInfo.ShiCiRoot); } // 中断剑谱对话 if (JianPuLogic.Instance() != null) { CloseUI(UIInfo.JianPuRoot); } // 隐藏二级UI节点 m_instance.PopUIRoot.gameObject.SetActive(false); m_instance.MenuPopUIRoot.gameObject.SetActive(false); m_instance.TipUIRoot.gameObject.SetActive(false); }
public override void Start() { base.Start(); // 检测一些前置的条件 if (m_nStoryID < 0) { base.Finish(); } Tab_StoryTable storyTable = TableManager.GetStoryTableByID(m_nStoryID, 0); if (storyTable == null) { Module.Log.LogModule.ErrorLog("Can not find storyTable {0}", m_nStoryID); base.Finish(); return; } int storyMissionID = storyTable.MissionID; if (storyMissionID > -1) { // 任务状态判断 MissionState misState = (MissionState)GameManager.gameManager.MissionManager.GetMissionState(storyMissionID); if (MissionState.Mission_Accepted != misState) { Module.Log.LogModule.ErrorLog("MissionState misState is failed {0}", m_nStoryID); StoryDialogLogic.ShowStory(storyTable.ClientStoryID, 0, StoryDialogOverCallback, 0); base.Finish(); return; } } // NPC距离判断 Tab_ClientStoryTable storyLine = TableManager.GetClientStoryTableByID(storyTable.ClientStoryID, 0); if (storyLine == null) { base.Finish(); return; } // // 全填-1的时候不检测距离 // if (storyLine.TargetPosX > -1 && storyLine.TargetPosZ > -1 && storyLine.TargetPosRadius > -1) // { // Vector3 userPos = new Vector3(0, 0, 0); // if (Singleton<ObjManager>.GetInstance().MainPlayer != null) // { // userPos = Singleton<ObjManager>.GetInstance().MainPlayer.Position; // } // else // { // userPos = GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterScenePos; // } // // Vector3 targetPos = new Vector3(storyLine.TargetPosX, 0, storyLine.TargetPosZ); // targetPos.y = userPos.y; // float dis = Mathf.Abs(Vector3.Distance(userPos, targetPos)); // if (dis > storyLine.TargetPosRadius) // { // base.Finish(); // } // } // 所有前置判断结束,真的可以进入剧情了 m_nMissionID = storyMissionID; m_nClientStoryID = storyTable.ClientStoryID; m_nDialogType = storyLine.DialogType; m_nDialogID = 0; // 大对话框 if (m_nDialogType == 0) { // 判断是否进入ModelStory模式 Singleton <ObjManager> .Instance.MainPlayer.IsInModelStory = IsNeedSilentMode(m_nStoryID); #if BOBJOYSTICK JoyControllerLogic.storyDialogOn = true; #endif } // 小对话框 else if (m_nDialogType == 1) { } StoryDialogLogic.ShowStory(m_nClientStoryID, 0, StoryDialogOverCallback, m_nDialogType); }
// 接任务和交任务UI public void MissionUI(int nMissionID, MissionUIType type) { // 先清理 CleanUp(); if (nMissionID < 0) { LogModule.ErrorLog("MissionID: {0} can not less then 0", nMissionID); return; } m_CurMissionID = nMissionID; Tab_MissionDictionary MDLine = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (MDLine == null) { LogModule.ErrorLog("Can not find MissionDictionary {0}", nMissionID); return; } m_MissionType = type; if (type == MissionUIType.TYPE_ACCETP) { m_AcceptButton.SetActive(true); m_CompleteButton.SetActive(false); m_MissionInfoAward.SetActive(true); StoryDialogLogic.ShowMissionStory(StrDictionary.GetClientString_WithNameSex(MDLine.MissionDesc), false, false); m_CurTalkID = MDLine.AcceptTalkID; GameManager.gameManager.SoundManager.PlaySoundEffect(m_CurTalkID); } else if (type == MissionUIType.TYPE_COMPLETE) { m_AcceptButton.SetActive(false); m_CompleteButton.SetActive(true); m_MissionInfoAward.SetActive(true); StoryDialogLogic.ShowMissionStory(StrDictionary.GetClientString_WithNameSex(MDLine.MissionDoneDesc), false, false); } Tab_MissionBase misLine = TableManager.GetMissionBaseByID(nMissionID, 0); if (misLine == null) { LogModule.ErrorLog("Can not find missionBase {0}", nMissionID); return; } if (misLine.MissionType == (int)MISSIONTYPE.MISSION_BRANCH && type == MissionUIType.TYPE_ACCETP) { m_NoAcceptButton.SetActive(true); } else { m_NoAcceptButton.SetActive(false); } if (misLine.BonusID > -1) { //显示奖励内容 Tab_MissionBonus bonusTab = TableManager.GetMissionBonusByID(misLine.BonusID, 0); if (bonusTab == null) { LogModule.ErrorLog("Can not find missionBonus {0}", misLine.BonusID); } else { // 最多一共7个奖励 按顺序显示 物品(最多4个) 玩家经验 宠物经验 金钱 int currentAwardItemIdx = 0; // 物品 if (bonusTab.getToolIDCount() > 0) { for (int i = 0; i < bonusTab.getToolIDCount(); i++) { Tab_CommonItem commonItem = TableManager.GetCommonItemByID(bonusTab.GetToolIDbyIndex(i), 0); if (commonItem != null && bonusTab.GetToolNumbyIndex(i) > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length) { int nItemCount = bonusTab.GetToolNumbyIndex(i); m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true); m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_Item(commonItem.Id, ItemSlotLogic.OnClickOpenTips, nItemCount > 1 ? nItemCount.ToString() : "", nItemCount > 1); currentAwardItemIdx += 1; } } } // 玩家经验 if (bonusTab.Exp > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length) { m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true); m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_PlayerExp(bonusTab.Exp.ToString()); currentAwardItemIdx += 1; } // 宠物经验 if (bonusTab.FellowExp > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length) { m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true); m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_FellowExp(bonusTab.FellowExp.ToString()); currentAwardItemIdx += 1; } // 金钱 金币和绑定点券 一般不会共存 if (bonusTab.Money > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length) { m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true); m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_Coin(null, bonusTab.Money.ToString(), true); currentAwardItemIdx += 1; } if (bonusTab.BindYuanBao > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length) { m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true); m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_YuanbaoBind(null, bonusTab.BindYuanBao.ToString(), true); currentAwardItemIdx += 1; } if (m_MissionItemGrid) { m_MissionItemGrid.Reposition(); } } } GameManager.gameManager.SoundManager.PlaySoundEffect(128); #if BOBJOYSTICK RefreshJoyGUI(type); #endif }