/// <summary> /// 家泳那边没有单个更新 /// </summary> public void UpdateNpcState(CEventBaseArgs args) { if (IsEnable == false) { return; } foreach (var kv in mNpcListPointObjs) { uint state = NpcHelper.GetNpcTaskState(kv.Key);//npcId UpdateOneNpc(state, kv.Value); } }
public void CreateNpcPoint() { var List = MiniMapHelp.GetInstanceAllNpc(m_CurSceneId); for (int i = 0; i < List.Count; i++) { var info = List[i]; uint state = NpcHelper.GetNpcTaskState((uint)info.Id, m_CurSceneId);//npcId if (IsDisplayNpcByTaskState(state)) { var rect = GetItem(m_NpcPoint); UpdateOneNpc(state, rect.gameObject); Vector3 vect = new Vector3((info.Position.x - minX) / uiScalex, (info.Position.z - minY) / uiScaley, 0); rect.localPosition = vect; Text nameText = UIHelper.FindChild(rect.gameObject, "NameText").GetComponent <Text>(); nameText.text = info.BlackName; Button btn = rect.GetComponent <Button>(); btn.onClick.RemoveAllListeners(); btn.onClick.AddListener(() => { OnClickNpcPoint(info); }); mNpcListPointObjs.Add((uint)info.Id, rect.gameObject); } } }