private UIMiniMapInterfaceWarning GetMapWarning(UInt64 guid) { if (mMapWarningDic == null || mMapWarningDic.Count == 0) { return(null); } UIMiniMapInterfaceWarning element = null; mMapWarningDic.TryGetValue(guid, out element); return(element); }
/// <summary> /// 移出地图元素 /// </summary> /// <param name="entity"></param> private void RemoveMapWarning(UInt64 guid) { UIMiniMapInterfaceWarning element = GetMapWarning(guid); if (element == null) { return; } GameObjectPool.Instance.ReleaseGO(element.resPath, element.gameObject, PoolObjectType.POT_MiniMap); mMapWarningDic.Remove(guid); EventCenter.Broadcast(EGameEvent.eGameEvent_ChangeMapState); }
private void AddMapWarning(UInt64 guid) { if (!EntityManager.AllEntitys.ContainsKey(guid)) { return; } Ientity entity = EntityManager.AllEntitys[guid]; if (entity == null || entity.realObject == null || !entity.realObject.activeInHierarchy) { return; } bool isAllow = false; if (entity.entityType != EntityType.Player && entity.entityType != EntityType.Soldier && entity.entityType != EntityType.AltarSoldier) { isAllow = false; } if (SceneGuideTaskManager.Instance().IsNewsGuide() != SceneGuideTaskManager.SceneGuideType.NoGuide && (entity.NpcGUIDType == 21017 || entity.NpcGUIDType == 21025 || entity.NpcGUIDType == 21024)) { isAllow = true; } if (!isAllow) { return; } if (entity.FSM != null && entity.FSM.State == BlGame.FSM.FsmState.FSM_STATE_DEAD) { return; } UIMiniMapInterfaceWarning element = GetMapWarning(guid); Vector3 pos = entity.realObject.transform.position; if (element == null) { element = CreateMapElementWarning(guid, pos.x, pos.y, pos.z); mMapWarningDic.Add(guid, element); } else { element.UpdatePosDirect(pos.x, pos.y, pos.z); } }