void SetTipText(int nMissionID, byte yQuality) { Tab_MissionBase MissionBase = TableManager.GetMissionBaseByID(nMissionID, 0); if (MissionBase == null || MissionBase.MissionType != (int)MISSIONTYPE.MISSION_DAILY) { LogModule.ErrorLog("Can not find missionBase {0}", nMissionID); return; } Tab_DailyMission DailyMission = TableManager.GetDailyMissionByID(MissionBase.DalityMissionTabID, 0); if (DailyMission == null) { LogModule.ErrorLog("Can not find DailyMission {0}", MissionBase.DalityMissionTabID); return; } Tab_MissionDictionary MisDec = TableManager.GetMissionDictionaryByID(MissionID, 0); if (MisDec == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", MissionID); return; } if (m_NameText && m_QualityColorText && m_ActivenessText && m_MisDec) { m_NameText.text = DailyMission.Name; m_QualityColorText.text = GetStrColorByQuality(yQuality); m_ActivenessText.text = "+" + DailyMission.AwardActiveness; m_MisDec.text = MisDec.MissionDesc; } return; }
// 立即前往 void ButtonGo() { Tab_MissionDictionary DicTab = TableManager.GetMissionDictionaryByID(GlobeVar.PAOSHANG_MISSIONID_H, 0); if (DicTab == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", GlobeVar.PAOSHANG_MISSIONID_H); return; } // 自动寻路 AutoSearchPoint point = new AutoSearchPoint(DicTab.AccepteNpcSceneID, DicTab.AccepteNpcPosX, DicTab.AccepteNpcPosZ); if (GameManager.gameManager && GameManager.gameManager.AutoSearch) { string sAutoSearchTargetName = string.Empty; Tab_RoleBaseAttr RoleBase = TableManager.GetRoleBaseAttrByID(DicTab.AcceptNpcDataID, 0); if (null != RoleBase) { sAutoSearchTargetName = RoleBase.Name; } else { LogModule.ErrorLog("Can not find roleBaseAttr {0}", DicTab.AcceptNpcDataID); } GameManager.gameManager.AutoSearch.ProcessAutoSearch(point, sAutoSearchTargetName, false); } }
public void UpdateMissionEffect() { Tab_MissionDictionary tabMissionDic = TableManager.GetMissionDictionaryByID(m_MissionID, 0); bool bIsDifficult = tabMissionDic.IsDifficult; m_Effect.SetActive(!bIsDifficult); m_EffectDiff.SetActive(bIsDifficult); }
public override void Init(ChatInfoSelectLinkLogic.Data data, int index) { base.Init(data, index); m_missionId = data.id; int nMissionID = data.id; this.name = string.Format("{0:D4}", index); Tab_MissionDictionary MissionDic = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (MissionDic == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); return; } byte yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID); string strMissionColor = MissionDialogAndLeftTabsLogic.GetColorByQuality(yMissionQuality); m_missionName.text = string.Format(MissionDic.MissionName, strMissionColor, "[ffe6b4]"); }
/// <summary> /// 设置数据 /// </summary> /// <param name="mission"></param> public void SetData(Tab_DailyMission mission) { mMissionId = mission.MissionID; mGoToUIId = mission.UIName; MissionManager missionManager = GameManager.gameManager.MissionManager; Tab_MissionDictionary missionDic = TableManager.GetMissionDictionaryByID(mMissionId, 0); Tab_MissionBase missionBase = TableManager.GetMissionBaseByID(mMissionId, 0); if (missionBase == null || missionBase.LogicType != (int)TableType.Table_OperationNum) { LogModule.WarningLog("DailyMission Logic Type Error, id = " + mission.Id); return; } Tab_MissionOperationNum missionOp = TableManager.GetMissionOperationNumByID(missionBase.LogicID, 0); lblMissionName.text = string.Format(missionDic.MissionName, "", ""); sprIcon.spriteName = missionDic.MissionIcon; lblDesc.text = missionDic.MissionDesc; lblActive.text = StrDictionary.GetClientDictionaryString("#{1634}", mission.AwardActiveness); int progress = missionOp.OperationCount; if (missionManager.IsHaveMission(mMissionId)) { progress = missionManager.GetMissionParam(mMissionId, 0); doneArea.SetActive(false); rewardArea.SetActive(true); btnClaim.SetActive(missionManager.GetMissionState(mMissionId) == (byte)MissionState.Mission_Completed); UIEventListener.Get(btnClaim).onClick = ClaimReward; SetRewards(mission); } else { doneArea.SetActive(true); rewardArea.SetActive(false); btnClaim.SetActive(false); } lblProgress.text = progress + "/" + missionOp.OperationCount; UpdateProgress(progress, missionOp.OperationCount); UIEventListener.Get(btnGoTo).onClick = GoToUI; }
// 设置Item名字、状态UI void SetMissionLogItem() { if (m_MissionID < 0) { return; } CleanUpInfo(); Tab_MissionDictionary MisDictionary = TableManager.GetMissionDictionaryByID(m_MissionID, 0); if (MisDictionary != null) { if (m_MissionName) { m_MissionName.text = string.Format(MisDictionary.MissionName, "", ""); } } else { LogModule.ErrorLog("Can not find missionDictionary {0}", m_MissionID); } // 状态 // byte byMisState = GameManager.gameManager.MissionManager.GetMissionState(m_MissionID); // if (byMisState < MaxStateCount) // { // for (byte i = 0; i < MaxStateCount; i++ ) // { // if (byMisState == i) // { // m_MissionState[i].gameObject.SetActive(true); // } // else // m_MissionState[i].gameObject.SetActive(false); // } // } }
/// <summary> /// 插入任务链接数据 /// </summary> /// <param name="missionId"></param> public void InsertMissionLinkText(int nMissionID) { ClearLinkBuffer(); Tab_MissionDictionary MissionDic = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (MissionDic == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); return; } byte yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID); string strMissionColor = MissionDialogAndLeftTabsLogic.GetColorByQuality(yMissionQuality); //发送给服务器的链接携带的数据 m_missionBuffer.missionId = nMissionID; m_missionBuffer.missionDesc = ""; m_missionBuffer.missionAwardId = -1; m_missionBuffer.missionName = ""; m_missionBuffer.missionName = string.Format(MissionDic.MissionName, strMissionColor, "[ffe6b4]"); m_missionBuffer.missionDesc = "[ffe6b4]" + string.Format(MissionDic.FollowText, "[fe3737]", "0"); if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID) { m_missionBuffer.missionAwardId = GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID(); } MissionState misState = (MissionState)GameManager.gameManager.MissionManager.GetMissionState(nMissionID); if (MissionState.Mission_Completed == misState) { m_missionBuffer.missionName = string.Format(MissionDic.MissionName, "[1fff1f]", "[1fff1f]"); int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0); m_missionBuffer.missionDesc = "[1fff1f]" + string.Format(MissionDic.FollowText, "[1fff1f]", nParam); if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID) { m_missionBuffer.missionAwardId = GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID(); } } else { string StrMissionTile = MissionDic.MissionName; if (MissionState.Mission_Failed == misState) { StrMissionTile = "[fe3737]" + StrDictionary.GetClientDictionaryString("#{1362}") + StrMissionTile; } m_missionBuffer.missionName = string.Format(StrMissionTile, strMissionColor, "[ffe6b4]"); if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID) { m_missionBuffer.missionAwardId = GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID(); } int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0); if (nParam != 0) { m_missionBuffer.missionDesc = "[ffe6b4]" + string.Format(MissionDic.FollowText, "[fe3737]", nParam); } } m_eChatLinkType = ChatInfoLogic.LINK_TYPE.LINK_TYPE_MISSION; m_LinkText = "[" + m_missionBuffer.missionName + "]"; m_LoudSpeakerInput.value = string.Format("{0}{1}", m_LinkText, StrDictionary.GetClientDictionaryString("#{10676}")); }
void SetData(int missionId) { mMissionId = missionId; // 任务基本 Tab_MissionBase mission = TableManager.GetMissionBaseByID(mMissionId, 0); if (mission == null) { Debug.LogError("No MissionBase Error, id = " + mMissionId); return; } // 任务字典 Tab_MissionDictionary missionDic = TableManager.GetMissionDictionaryByID(mMissionId, 0); if (missionDic == null) { Debug.LogError("No MissionDictionary Error, id = " + mMissionId); return; } lblMissionName.text = string.Format(missionDic.MissionName, "", ""); lblMissionDesc.text = StrDictionary.GetClientString_WithNameSex(missionDic.MissionDesc); // 任务奖励 Utils.CleanGrid(rewardList); Tab_MissionBonus missionBonus = TableManager.GetMissionBonusByID(mission.BonusID, 0); if (missionBonus == null) { Debug.LogError("No Tab_MissionBonus Error, mission id = " + mMissionId + ", bonus id = " + mission.BonusID); return; } // 经验 if (missionBonus.Exp > 0) { AddRewardItem(ItemType.ITEM_EXP, -1, missionBonus.Exp); } // 金币 if (missionBonus.Money > 0) { AddRewardItem(ItemType.ITEM_MONEY, -1, missionBonus.Money); } // 绑定元宝 if (missionBonus.BindYuanBao > 0) { AddRewardItem(ItemType.ITEM_YUANBAO, -1, missionBonus.BindYuanBao); } // 物品 for (int i = 0; i < missionBonus.getToolIDCount(); i++) { int itemId = missionBonus.GetToolIDbyIndex(i); int itemCount = missionBonus.GetToolNumbyIndex(i); if (itemCount <= 0) { continue; } AddRewardItem(ItemType.ITEM_ITEM, itemId, itemCount); } // 职业奖励 int nProfess = Singleton <ObjManager> .GetInstance().MainPlayer.Profession; if (nProfess >= 0 && nProfess < missionBonus.getProfessionItemIDCount()) { AddRewardItem(ItemType.ITEM_ITEM, missionBonus.GetProfessionItemIDbyIndex(nProfess), missionBonus.GetProfessionNumbyIndex(nProfess)); } // 多选物品 int nChoosedItemdNum = missionBonus.ChoosedItemNum; if (nChoosedItemdNum > 0 && nChoosedItemdNum <= missionBonus.getItemIDCount()) { AddRewardItem(ItemType.ITEM_ITEM, missionBonus.GetItemIDbyIndex(nChoosedItemdNum - 1), missionBonus.GetItemNumbyIndex(nChoosedItemdNum - 1)); } rewardList.GetComponent <UIGrid>().Reposition(); }
// 接任务和交任务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 }
bool UpdateMissionItem(int nMissionID) { if (nMissionID < 0) { return(false); } int nIndex = -1; for (int i = 0; i < m_MissionItemsList.Count; i++) { int ItemMissionID = m_MissionItemsList[i].MissionID; if (ItemMissionID == nMissionID) { nIndex = i; break; } } // 没任务 if (nIndex < 0 || nIndex >= m_MissionItemsList.Count) { return(false); } Tab_MissionDictionary MDLine = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (MDLine == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); } else { int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0); if (nParam != 0) { m_MissionItemsList[nIndex].MissionInfo.text = "[489667]" + string.Format(MDLine.FollowText, "[489667]", nParam); } } MissionState misState = (MissionState)GameManager.gameManager.MissionManager.GetMissionState(nMissionID); if (MissionState.Mission_Completed == misState) { UIManager.ShowUI(UIInfo.MissionCompletefEffect); //string StrMissionTile = MDLine.MissionName;//m_MissionItemsList[nIndex].GetComponent<MissionItemLogic>().MissionTile.text;//StrDictionary.GetClientDictionaryString("#{1361}") + m_MissionItemsList[nIndex].GetComponent<MissionItemLogic>().MissionTile.text; m_MissionItemsList[nIndex].MissionTile.text = string.Format(MDLine.MissionName, "[AFF9CD]", "[AFF9CD]"); int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0); m_MissionItemsList[nIndex].MissionInfo.text = "[AFF9CD]" + string.Format(MDLine.FollowText, "[AFF9CD]", nParam); m_MissionItemsList[nIndex].OnUpdateMissionStateIcon(misState); UpdateMissionFollowBlink(nIndex, true); // 移位 MissionItemLogic TempObj = m_MissionItemsList[nIndex]; m_MissionItemsList.RemoveAt(nIndex); m_MissionItemsList.Insert(0, TempObj); for (int i = 0; i < m_MissionItemsList.Count; i++) { m_MissionItemsList[i].name = "MissionItem" + i; } m_CommpletedItemCount += 1; // 添加新手指引 if (nMissionID == 2 || nMissionID == 6) { m_GuideMissionFlag = true; ShowNewPlayerGuide(nMissionID); } // 乱七八糟的新手指引 SetVictorNewGuild(nMissionID); } else { string StrMissionTile = MDLine.MissionName; if (MissionState.Mission_Failed == misState) { StrMissionTile = "[fe3737]" + StrDictionary.GetClientDictionaryString("#{1362}") + StrMissionTile; } byte yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID); string strMissionColor = GetColorByQuality(yMissionQuality); m_MissionItemsList[nIndex].MissionTile.text = string.Format(StrMissionTile, strMissionColor, "[489667]");//"[fe3737]" + StrMissionTile; m_MissionItemsList[nIndex].OnUpdateMissionStateIcon(misState); UpdateMissionFollowBlink(nIndex, false); } return(true); }
// 创建MissionItem bool AddMissionItem(int nMissionID, GameObject resItem) { if (nMissionID < 0) { return(false); } Tab_MissionDictionary MissionDic = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (MissionDic == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); return(false); } if (m_CommpletedItemCount < 0) { return(false); } for (int i = 0; i < m_MissionItemsList.Count; ++i) { if (null != m_MissionItemsList[i]) { if (m_MissionItemsList[i] && m_MissionItemsList[i].MissionID == nMissionID) { return(false); } } } GameObject ItemObj = Utils.BindObjToParent(resItem, m_MissionsList.gameObject, "MissionItem-1"); if (ItemObj) { MissionItemLogic MissionItem = ItemObj.GetComponent <MissionItemLogic>(); if (MissionItem == null) { return(false); } byte yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID); string strMissionColor = GetColorByQuality(yMissionQuality); MissionItem.MissionID = nMissionID; MissionItem.MissionTile.text = string.Format(MissionDic.MissionName, strMissionColor, "[489667]"); MissionItem.MissionInfo.text = "[489667]" + string.Format(MissionDic.FollowText, "[489667]", "0"); MissionItem.UpdateMissionEffect(); // if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID) // { // MissionItem.SetAwardItemID(GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID()); // } // else // MissionItem.SetAwardItemID(-1); //if (GameManager.gameManager.MissionManager.GetMissionType(nMissionID) == (int)MISSIONTYPE.MISSION_PAOHUAN) //{ // MissionItem.SetAwardItemID(GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID()); //} //else // MissionItem.SetAwardItemID(-1); // 主线任务放在接任务最上面 int nTempIndex = m_CommpletedItemCount; if (nTempIndex >= 0 && nTempIndex < m_MissionItemsList.Count && (int)MISSIONTYPE.MISSION_MAIN == GameManager.gameManager.MissionManager.GetMissionType(m_MissionItemsList[nTempIndex].MissionID)) { nTempIndex++; } if (nTempIndex > m_MissionItemsList.Count) { nTempIndex = m_MissionItemsList.Count; } m_MissionItemsList.Insert(nTempIndex, MissionItem); } m_AcceptMissionButton.SetActive(false); return(true); }
// 策划要求:任务追踪 跨场景不变 添加 任务Item并设置状态 void InitMissionItemList(List <int> nMissionSortList, GameObject resItem) { for (int i = 0; i < nMissionSortList.Count; ++i) { int nMissionID = nMissionSortList[i]; if (nMissionID < 0) { return; } Tab_MissionDictionary MissionDic = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (MissionDic == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); return; } GameObject ItemObj = Utils.BindObjToParent(resItem, m_MissionsList.gameObject, "MissionItem" + i); if (ItemObj) { MissionItemLogic MissionItem = ItemObj.GetComponent <MissionItemLogic>(); if (MissionItem == null) { return; } byte yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID); string strMissionColor = GetColorByQuality(yMissionQuality); MissionItem.MissionID = nMissionID; MissionItem.MissionTile.text = string.Format(MissionDic.MissionName, strMissionColor, "[489667]"); MissionItem.MissionInfo.text = "[489667]" + string.Format(MissionDic.FollowText, "[489667]", "0"); MissionItem.OnUpdateMissionStateIcon(MissionState.Mission_None); MissionItem.UpdateMissionEffect(); m_MissionItemsList.Add(MissionItem); SetPaoHuanAwardItemID(); // 设置状态 MissionState misState = (MissionState)GameManager.gameManager.MissionManager.GetMissionState(nMissionID); if (MissionState.Mission_Completed == misState) { MissionItem.MissionTile.text = string.Format(MissionDic.MissionName, "[AFF9CD]", "[AFF9CD]"); int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0); MissionItem.MissionInfo.text = "[AFF9CD]" + string.Format(MissionDic.FollowText, "[AFF9CD]", nParam); MissionItem.OnUpdateMissionStateIcon(misState); // if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID) // MissionItem.SetAwardItemID (GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID ()); // else // MissionItem.SetAwardItemID (-1); UpdateMissionFollowBlink(i, true); m_CommpletedItemCount += 1; // 添加新手指引 if (nMissionID == 2 || nMissionID == 7) { m_GuideMissionFlag = true; ShowNewPlayerGuide(nMissionID); } } else { string StrMissionTile = MissionDic.MissionName; if (MissionState.Mission_Failed == misState) { StrMissionTile = "[489667]" + StrDictionary.GetClientDictionaryString("#{1362}") + StrMissionTile; } MissionItem.MissionTile.text = string.Format(StrMissionTile, strMissionColor, "[489667]"); // if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID) // MissionItem.SetAwardItemID (GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID ()); // else // MissionItem.SetAwardItemID (-1); int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0); if (nParam != 0) { MissionItem.MissionInfo.text = "[489667]" + string.Format(MissionDic.FollowText, "[489667]", nParam); MissionItem.OnUpdateMissionStateIcon(misState); } } } } SortMissionItem(); if (m_MissionsList) { #if UNITY_WP8 DoRepositionForce(); #else m_MissionsList.repositionNow = true; #if BOBJOYSTICK RefreshJoyGUI(); #endif #endif } }
// 任务显示相关 void UpdateMissionInfo(int nData) { CleanMissionInfo(); int nMissionID = nData % 10000; int nRoundIndex = (nData / 10000) % 100; int nAcptedTimes = nData / 1000000; // 大于0 才是 帮会任务 // 没有帮会 也不显示 PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool; if (MyPlayerData == null) { return; } if (MyPlayerData.GuildInfo == null) { return; } if (false == MyPlayerData.IsHaveGuild()) { return; } Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0); if (guildMisGuild == null) { LogModule.ErrorLog("Can not find guildMisGuild {0}", MyPlayerData.GuildInfo.GuildLevel); return; } // 按钮显示否 if (nAcptedTimes <= guildMisGuild.MemMaxTimesOneDay) { if (nRoundIndex < guildMisGuild.MemMisRoundNumOnce) { // 还没任务呢 if (nMissionID <= 0) { if (m_JoinButton) { m_JoinButton.isEnabled = true; } } else { if (m_MissionOptButton) { m_MissionOptButton.isEnabled = true; } } } else { if (m_JoinButton && nAcptedTimes < guildMisGuild.MemMaxTimesOneDay) { m_JoinButton.isEnabled = true; } } } Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (mainPlayer == null) { return; } if (nMissionID > 0) { Tab_MissionBase misTab = TableManager.GetMissionBaseByID(nMissionID, 0); if (misTab == null) { LogModule.ErrorLog("Can not find missionBase {0}", nMissionID); return; } else if (misTab.MissionType != (int)MISSIONTYPE.MISSION_GUILD) { return; } Tab_MissionDictionary misDic = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (misDic == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); return; } Tab_GuildMission guildMis = TableManager.GetGuildMissionByID(misTab.GuildMissionTabID, 0); if (guildMis == null) { LogModule.ErrorLog("Can not find guidMission {0}", misTab.GuildMissionTabID); return; } if (m_MisNameLabel && m_MisInfoLabel) { m_MisNameLabel.text = string.Format(misDic.MissionName, "[ffffff]", "[ffffff]"); m_MisInfoLabel.text = misDic.MissionDesc; } // 金币 经验 Tab_GuildMissionAward awardTab = TableManager.GetGuildMissionAwardByID(mainPlayer.BaseAttr.Level, 0); if (awardTab == null) { LogModule.ErrorLog("Can not find guidMissionAward {0}", mainPlayer.BaseAttr.Level); return; } float fMisMoney = guildMis.AwardMoney * guildMisGuild.AwardFactor * awardTab.GetExpQualityFactorbyIndex((int)(MISSION_QUALITY.MISSION_QUALITY_PURPLE - 1)) * awardTab.MoneyFactor; float fMisExp = guildMis.AwardExp * guildMisGuild.AwardFactor * awardTab.GetExpQualityFactorbyIndex((int)(MISSION_QUALITY.MISSION_QUALITY_PURPLE - 1)) * awardTab.ExpFactor; if (m_MisMoneyLabel && m_MisExpLabel) { m_MisMoneyLabel.text = ((int)fMisMoney).ToString(); m_MisExpLabel.text = ((int)fMisExp).ToString(); } UpdateMissionState(nMissionID); // 任务环数 if (m_MisRoundInfoLabel && nRoundIndex >= 0) { m_MisRoundInfoLabel.text = nRoundIndex + "/" + guildMisGuild.MemMisRoundNumOnce; } } }