void CleanUp() { if (m_MissionInfoAward && m_AcceptButton && m_CompleteButton && m_NoAcceptButton) { m_MissionInfoAward.SetActive(false); m_AcceptButton.SetActive(false); m_CompleteButton.SetActive(false); m_NoAcceptButton.SetActive(false); } for (int i = 0; i < m_MissionBonusItemSlot.Length; i++) { m_MissionBonusItemSlot[i].gameObject.SetActive(false); } if (m_MissionItemGrid) { m_MissionItemGrid.Reposition(); } m_CurMissionID = GlobeVar.INVALID_ID; m_MissionType = MissionUIType.TYPE_NONE; if (m_CurTalkID > 0) { GameManager.gameManager.SoundManager.StopSoundEffect(m_CurTalkID); m_CurTalkID = -1; } }
void RefreshJoyGUI(MissionUIType type) { System.Collections.Generic.List <GameObject> m_uiItems = new System.Collections.Generic.List <GameObject>(); Engine.JoyUI.BobJoyUINavigator m_JoyUINav; System.Collections.Generic.List <Transform> functionbuttons = new System.Collections.Generic.List <Transform>(); functionbuttons.Add(this.m_AcceptButton.transform); functionbuttons.Add(this.m_CompleteButton.transform); for (int i = 0; i < functionbuttons.Count; ++i) { m_uiItems.Add(functionbuttons[i].gameObject); } if (type == MissionUIType.TYPE_COMPLETE) { m_JoyUINav = BobJoyUINavigator.SetJoyController(gameObject, m_uiItems, JoyControllerLogic.FindChild(transform, "MissionInfoCloseButton").gameObject, JoyControllerLogic.FindChild(transform, "MissionInfoComPleteButton").gameObject); } else if (type == MissionUIType.TYPE_ACCETP) { m_JoyUINav = BobJoyUINavigator.SetJoyController(gameObject, m_uiItems, JoyControllerLogic.FindChild(transform, "MissionInfoCloseButton").gameObject, JoyControllerLogic.FindChild(transform, "MissionInfoAcceptButton").gameObject); } else { m_JoyUINav = BobJoyUINavigator.SetJoyController(gameObject, m_uiItems, JoyControllerLogic.FindChild(transform, "MissionInfoCloseButton").gameObject, null); } }
public MissionUIInfo(int missionID, MissionUIType type) { _nMissionID = missionID; _type = type; }
// 接任务和交任务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 }
public static void ShowMissionDialogUI(int nMissionID, MissionUIType type) { MissionUIInfo curInfo = new MissionUIInfo(nMissionID, type); UIManager.ShowUI(UIInfo.MissionInfoController, OnShowMissionDialogUI, curInfo); }