protected int RefreshTask(TaskType _type, int _startIndex) { TaskMng taskMng = GameCenter.taskMng; Dictionary<int, TaskInfo> taskDic = taskMng.GetTaskDic(_type); int index = _startIndex; foreach (TaskInfo item in taskDic.Values) { if (_type == TaskType.Trial && (item.TaskState == TaskStateType.UnTake || item.TaskState == TaskStateType.ENDED)) continue;//未接取的试炼任务不显示(显示特殊任务) if (_type == TaskType.Ring && (taskMng.IsShowSpecislRingTask() || taskMng.FinishAllRingTask)) continue;//未接取的环任务不显示(显示特殊任务) if (_type == TaskType.Ring && !taskMng.IsShowThisRingTask(item.StarLevel)) continue; if(_type == TaskType.Special && !item.SpecialTaskCanShow)continue;//特殊任务显示有等级要求 if (_type == TaskType.Special && item.ID == 10001 && (!taskMng.IsShowSpecislRingTask() || taskMng.FinishAllRingTask)) continue;//身上有环任务or所有环任务已完成,不显示特殊(环)任务 if(_type == TaskType.Special && item.ID == 10002 && (taskMng.HaveTrialTask() || (taskMng.FinishAllTrialTask() && GameCenter.taskMng.TrialTaskRestRewardTimes <= 0)))continue;//身上有试炼任务,不显示特殊(试炼)任务 if (taskList.Count < index + 1) { TaskListSingle single = taskListSingleInstance.CreateNew(taskParent.transform, index); taskList.Add(single); taskParent.AddChild(single.transform); UIEventListener.Get(taskList[index].gameObject).onClick -= OnClickTaskBtn; UIEventListener.Get(taskList[index].gameObject).onClick += OnClickTaskBtn; } if (taskList[index] != null) { taskList[index].gameObject.SetActive(true); taskList[index].MyTaskInfo = item; } index++; } return index; }
public void Init(TaskMng taskMng) { taskMng.ReceiverRegister <Task>(this); }
void Awake() { _instance = this; }
protected void Init(MainPlayerInfo _mainplayerInfo) { mainPlayerInfo = _mainplayerInfo; functionList.Clear(); hasApplySubData = false; MsgHander.Regist(0xB107, S2C_OnChangePos); MsgHander.Regist(0xB104, S2C_OnLoginInGame); // MsgHander.Regist(0xD204, S2C_CollectResult); MsgHander.Regist(0xD01D, S2C_OnBaseValueChange); //MsgHander.Regist(0xD329, S2C_VIPResult); MsgHander.Regist(0xD442, S2C_ReinNum); MsgHander.Regist(0xB105, S2C_CurServerTime); //MsgHander.Regist(0xD779,S2C_ServerStartGuide); MsgHander.Regist(0xC105, S2C_UpdateFuncReward); //物品管理类 inventoryMng = InventoryMng.CreateNew(this); GameCenter.inventoryMng = inventoryMng; //宠物管理类 //petMng = PetMng.CreateNew(this); //GameCenter.petMng = petMng; //新排行榜管理类 newRankingMng = NewRankingMng.CreateNew(); GameCenter.newRankingMng = newRankingMng; //法宝管理类 magicWeaponMng = MagicWeaponMng.CreateNew(this); GameCenter.magicWeaponMng = magicWeaponMng; //成就管理类 achievementMng = AchievementMng.CreateNew(this); GameCenter.achievementMng = achievementMng; //七天奖励管理类 sevenDayMng = SevenDayMng.CreateNew(); GameCenter.sevenDayMng = sevenDayMng; //首冲大礼管理类 firstChargeBonusMng = FirstChargeBonusMng.CreateNew(); GameCenter.firstChargeBonusMng = firstChargeBonusMng; //翅膀管理类 wingMng = WingMng.CreateNew(this); GameCenter.wingMng = wingMng; rebornMng = RebornMng.CreateNew(this); GameCenter.rebornMng = rebornMng; // sceneAnimMng = SceneAnimMng.CreateNew(); // GameCenter.sceneAnimMng = sceneAnimMng; //随从管理类 mercenaryMng = MercenaryMng.CreateNew(); GameCenter.mercenaryMng = mercenaryMng; newMountMng = NewMountMng.CreateNew(); GameCenter.newMountMng = newMountMng; guildMng = GuildMng.CreateNew(this); GameCenter.guildMng = guildMng; dailyMustDoMng = DailyMustDoMng.CreateNew(); GameCenter.dailyMustDoMng = dailyMustDoMng; taskMng = TaskMng.CreateNew(this); GameCenter.taskMng = taskMng; teamMng = TeamMng.CreateNew(); GameCenter.teamMng = teamMng; // 好友管理类 by朱素云 friendsMng = FriendsMng.CreateNew(); GameCenter.friendsMng = friendsMng; // 等级奖励管理类 by朱素云 rankRewardMng = RankRewardMng.CreateNew(); GameCenter.rankRewardMng = rankRewardMng; // 修行管理类 by朱素云 practiceMng = PracticeMng.CreateNew(); GameCenter.practiceMng = practiceMng; // 仙侣管理类 by朱素云 coupleMng = CoupleMng.CreateNew(); GameCenter.coupleMng = coupleMng; // 周卡管理类 by朱素云 weekCardMng = WeekCardMng.CreateNew(); GameCenter.weekCardMng = weekCardMng; // 爱心礼包管理类 by朱素云 lovePackageMng = LovePackageMng.CreateNew(); GameCenter.lovePackageMng = lovePackageMng; // 结义管理类 by朱素云 swornMng = SwornMng.CreateNew(); GameCenter.swornMng = swornMng; //副本选择管理类 dungeonMng = DungeonMng.CreateNew(); GameCenter.dungeonMng = dungeonMng; // 火焰山战场管理类 by朱素云 battleFightMng = BattleFightMng.CreateNew(); GameCenter.battleFightMng = battleFightMng; //技能升级管理类 skillMng = SkillMng.CreateNew(ref skillMng); GameCenter.skillMng = skillMng; //称号管理类 by 贺丰 titleMng = TitleMng.CreateNew(ref titleMng); GameCenter.titleMng = titleMng; //邮箱管理类 mailBoxMng = XXMailMng.CreateNew(); GameCenter.mailBoxMng = mailBoxMng; endLessTrialsMng = EndLessTrialsMng.CreateNew(); GameCenter.endLessTrialsMng = endLessTrialsMng; //聊天管理类 chatMng = ChatMng.CreateNew(); GameCenter.chatMng = chatMng; // GameCenter.taskMng.updateSingleTask += TaskOpenFunction; GameCenter.taskMng.OnTaskGuideUpdateEvent += TaskProcessOpenFunction; GameCenter.taskMng.OnTaskFinishedGuideUpdateEvent += TaskFinishedOpenFunction; equipmentTraningMng = EquipmentTrainingMng.CreateNew(); GameCenter.equipmentTrainingMng = equipmentTraningMng; //时装管理类 fashionMng = FashionMng.CreateNew(this); GameCenter.fashionMng = fashionMng; //商店管理类 shopMng = ShopMng.CreateNew(this); GameCenter.shopMng = shopMng; //仙盟商店管理类 guildShopMng = GuildShopMng.CreateNew(this); GameCenter.guildShopMng = guildShopMng; //仙盟技能管理类 guildSkillMng = GuildSkillMng.CreateNew(this); GameCenter.guildSkillMng = guildSkillMng; //下载管理类 downloadBonusMng = DownloadBonusMng.CreateNew(this); GameCenter.downloadBonusMng = downloadBonusMng; //商城管理类 newMallMng = NewMallMng.CreateNew(this); GameCenter.newMallMng = newMallMng; //物品购买 buyMng = BuyMng.CreateNew(this); GameCenter.buyMng = buyMng; //交易 tradeMng = TradeMng.CreateNew(this); GameCenter.tradeMng = tradeMng; //充值管理 rechargeMng = RechargeMng.CreateNew(this); GameCenter.rechargeMng = rechargeMng; //市场 marketMng = MarketMng.CreateNew(this); GameCenter.marketMng = marketMng; //铸魂 castSoulMng = CastSoulMng.CreateNew(this); GameCenter.castSoulMng = castSoulMng; //在线奖励 onlineRewardMng = OnlineRewardMng.CreateNew(this); GameCenter.onlineRewardMng = onlineRewardMng; //仙域争霸 guildFightMng = GuildFightMng.CreateNew(this); GameCenter.guildFightMng = guildFightMng; //精彩活动 wdfActiveMng = WdfActiveMng.CreateNew(); GameCenter.wdfActiveMng = wdfActiveMng; //开服贺礼 openServerRewardMng = OpenServerRewardMng.CreateNew(this); GameCenter.openServerRewardMng = openServerRewardMng; //复活 resurrectionMng = ResurrectionMng.CreateNew(this); GameCenter.resurrectionMng = resurrectionMng; //小助手 littleHelperMng = LittleHelperMng.CreateNew(this); GameCenter.littleHelperMng = littleHelperMng; //藏宝阁管理类 treasureHouseMng = TreasureHouseMng.CreateNew(); GameCenter.treasureHouseMng = treasureHouseMng; //皇室宝箱管理类 royalTreasureMng = RoyalTreasureMng.CreateNew(); GameCenter.royalTreasureMng = royalTreasureMng; //奇缘系统管理类 newMiracleMng = MiracleMng.CreateNew(); GameCenter.miracleMng = newMiracleMng; //二冲系统管理类 newTwoChargeMng = TwoChargeMng.CreateNew(); GameCenter.twoChargeMng = newTwoChargeMng; bossChallengeMng = BossChallengeMng.CreateNew(); GameCenter.bossChallengeMng = bossChallengeMng; activityMng = ActivityMng.CreateNew(); GameCenter.activityMng = activityMng; //单人副本多人副本的管理类 duplicateMng = DuplicateMng.CreateNew(); GameCenter.duplicateMng = duplicateMng; //竞技场管理类 arenaMng = ArenaMng.CreateNew(); GameCenter.arenaMng = arenaMng; //新手引导管理类 noviceGuideMng = NoviceGuideMng.CreateNew(); GameCenter.noviceGuideMng = noviceGuideMng; //离线经验管理类 offLineRewardMng = OffLineRewardMng.CreateNew(); GameCenter.offLineRewardMng = offLineRewardMng; //VIP管理类 vipMng = VipMng.CreateNew(); GameCenter.vipMng = vipMng; //宝藏活动的管理类 treasureTroveMng = TreasureTroveMng.CreateNew(); GameCenter.treasureTroveMng = treasureTroveMng; //七日挑战管理类 sevenChallengeMng = SevenChallengeMng.CreateNew(); GameCenter.sevenChallengeMng = sevenChallengeMng; //走马灯 by hmj GameCenter.uIMng.GenGUI(GUIType.MERRYGOROUND, true); //MsgHander.Regist(0xD804,S2C_GuideSeqencingList); MsgHander.Regist(0xD786, S2C_ServerStartTime); MsgHander.Regist(0xD70A, S2C_StartCameraFocus); MsgHander.Regist(0xD70B, S2C_EndCameraFocus); IsUpdateQuestionList = true; serverStartTiem = DateTime.Now; }