public NpcMissState GetNpcMissState(int npcId, out _DBC_MISSION_DEMAND_LIST currMiss) { currMiss = null; if (npcId == MacroDefine.INVALID_ID) { return(NpcMissState.None); } CDetailAttrib_Player myData = CDetailAttrib_Player.Instance; NpcMissState state = NpcMissState.None; foreach (_DBC_MISSION_DEMAND_LIST miss in sceneMissions) { bool alreadyHave = myData.GetMissionIndexByID(miss.n_MissionID) != MacroDefine.INVALID_ID; if (miss.n_AcceptNpcID == npcId && state == NpcMissState.None && !alreadyHave) { state = NpcMissState.AcceptNormal; currMiss = miss; } else if (miss.n_FinishNpcID == npcId) { if (myData.IsMissionCanCommit(miss.n_MissionID)) { state = NpcMissState.FinishNormal; currMiss = miss; break; } else if (alreadyHave) { state = NpcMissState.ContinueNormal; currMiss = miss; } } } return(state); }
public void UpdateFuncEnable() { if (funcList.Count == 0) { UnRegistConditions(); return; } CObject_PlayerMySelf mySelf = CObjectManager.Instance.getPlayerMySelf(); CDetailAttrib_Player myData = CDetailAttrib_Player.Instance; if (mySelf == null || myData == null) { return; } ////////////////////////////////////////////////////////////////////////// // 由于界面表现要有特殊标示,所以特殊对待 int x1Pos = 0; int y2Pos = 45; int index = -1; ////////////////////////////////////////////////////////////////////////// foreach (_DBC_FUNC_OPEN_LIST enumerator in funcList) { index++; bool showEnable = true; _DBC_FUNC_OPEN_LIST func = enumerator; if (func.needLevel != MacroDefine.INVALID_ID && mySelf.GetCharacterData().Get_Level() < func.needLevel) { showEnable = false; } else if (func.receiveMission != MacroDefine.INVALID_ID) { if ((myData.GetMissionIndexByID(func.receiveMission) == MacroDefine.INVALID_ID) && !myData.IsMissionHaveDone((uint)func.receiveMission)) { showEnable = false; } } else if (func.finishMission != MacroDefine.INVALID_ID) { if (!myData.IsMissionHaveDone((uint)func.finishMission)) { showEnable = false; } } if (uiGoList[index] == null) { uiGoList[index] = GameObject.Find(enumerator.uiName); } if (uiGoList[index] != null) { if (showEnable) { if (uiGoList[index].layer != LayerManager.UILayer) { uiGoList[index].layer = LayerManager.UILayer; } ////////////////////////////////////////////////////////////////////////// Vector3 pos = uiGoList[index].transform.localPosition; switch (enumerator.specialTag) { case 1: pos.x = x1Pos; x1Pos -= 45; break; case 2: pos.y = y2Pos; y2Pos += 45; break; default: break; } uiGoList[index].transform.localPosition = pos; ////////////////////////////////////////////////////////////////////////// // funcList.Remove(enumerator.Current.Key); // enumerator = funcList.GetEnumerator(); } else { if (uiGoList[index].layer == LayerManager.UILayer) { uiGoList[index].layer = LayerManager.DefaultLayer; } } } } }