void Awake() { if (tree == null) { LogManager.LogError("UIQuestTrace init failed."); return; } tree.Clear(); // 允许鼠标穿透 [3/12/2012 Ivan] if (tree.list != null) { UISystem.Instance.AddHollowWindow(tree.transform.root.gameObject); } CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_TOGLE_MISSION_TRACE, UpdateMissionTrace); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_UPDATE_MISSION, UpdateMissionTrace); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_PACKAGE_ITEM_CHANGED, UpdateMissionTrace); }
void UpdateCurrList() { if (!gameObject.active) { return; } treeNode.Clear(); cmpWin.CleanAll(); int missNum = CDataPool.Instance.GetPlayerMission_Num(); if (missNum <= 0) { treeNode.AddItem("[#D2BE8C]没有任何任务。", "0"); return; } int firstMissId = -1; for (int i = 0; i < GAMEDEFINE.MAX_MISSION_PARAM_NUM; i++) { int missid = CDataPool.Instance.GetMissionIdByIndex(i); if (missid == -1) { continue; } _MISSION_INFO miss = CDataPool.Instance.GetPlayerMissionByIndex(i); if (!miss.m_bFill) { continue; } if (firstMissId == -1) { firstMissId = missid; } string name = UIString.Instance.ParserString_Runtime(miss.m_misName); treeNode.AddItem(name, missid.ToString(), KindName(miss.m_nKind)); } SelectMission(firstMissId); }