public void AddPointPrefab(GameObject target, eMapPointType type) { GameObject go; UIMapPoint p; switch (type) { case eMapPointType.FISH: go = ObjectPool.m_Instance.LoadGameObjectFromPool(9202); go.SetActive(true); p = go.GetComponent <UIMapPoint>(); p.Init(target, type); p.transform.SetParent(this.transform); m_PointList.Add(go); break; case eMapPointType.MISSIONTOWER: go = ObjectPool.m_Instance.LoadGameObjectFromPool(9203); go.SetActive(true); p = go.GetComponent <UIMapPoint>(); p.Init(target, type); p.transform.SetParent(this.transform); m_PointList.Add(go); break; } }
public void Init(GameObject target, eMapPointType type) { m_CurrentTarget = target; m_CurrentType = type; FindRadarCenter(); CalculatePosition(); switch (type) { case eMapPointType.FISH: FishAI fish = target.GetComponent <FishAI>(); fish.OnSpawn += ShowPoint; fish.OnDeath += HidePoint; break; case eMapPointType.MISSIONTOWER: m_Image = this.GetComponent <Image>(); //m_Color.r = 0.2666f; //m_Color.g = 0.843f; //m_Color.b = 1; m_Color = m_Image.color; MissionTower missionTower = target.GetComponent <MissionTower>(); missionTower.OnActive += CompletePoint; missionTower.OnActivating += MobManager.m_Instance.StopAutoSpawn; missionTower.OnActive += MobManager.m_Instance.StartAutoSpawn; UIPanelMap.Instance.DisplayPoint += ShowPoint; UIPanelMap.Instance.HidePoint += ClosePoint; break; } }
public void Init(GameObject target, eMapPointType type) { switch (type) { case eMapPointType.SPAWNPOINT: m_RectTransform = this.GetComponent <RectTransform>(); m_OriWidth = m_RectTransform.sizeDelta.x; m_OriHeight = m_RectTransform.sizeDelta.y; m_SpawnPoint = target; break; case eMapPointType.MISSIONTOWER: UIMissionBriefing.Instance.MissionIntroduction.OnSelect += Selected; UIMissionBriefing.Instance.MissionIntroduction.NotSelect += NotSelected; break; } }
public void Init(Player player, eMapPointType type) { m_CurrentPlayer = player; m_CurrentTarget = player.gameObject; m_CurrentType = type; m_Image = this.GetComponent <Image>(); m_Color = UIHelper.GetPlayerColor(player.SerialNumber); FindRadarCenter(); CalculatePosition(); switch (m_CurrentType) { case eMapPointType.PLAYER: m_CurrentPlayer.OnSpawnBegin += ShowPoint; m_CurrentPlayer.OnDeathBegin += HidePoint; break; } }
public void AddPointPrefab(Player player, eMapPointType type) { GameObject go; UIMapPoint p; switch (type) { case eMapPointType.PLAYER: go = ObjectPool.m_Instance.LoadGameObjectFromPool(9201); go.SetActive(true); p = go.GetComponent <UIMapPoint>(); p.Init(player, type); p.transform.SetParent(this.transform); m_PointList.Add(go); break; } }
public void AddPointPrefab(GameObject target, eMapPointType type) { UIMissionMapPoint mapPoint = null; switch (type) { case eMapPointType.MISSIONTOWER: mapPoint = Instantiate(m_TowerPointPrefab, m_MapPointRoot); mapPoint.Init(target, type); break; case eMapPointType.SPAWNPOINT: mapPoint = Instantiate(m_SpawnPointPrefab, m_MapPointRoot); mapPoint.Init(target, type); m_PointList.Add(mapPoint); break; } if (mapPoint != null) { CalculatePosition(target.transform.position, ref mapPoint); } }
public void Init(GameObject target, eMapPointType type) { m_CurrentTarget = target; m_CurrentType = type; m_Image = this.GetComponent <Image>(); m_Color = m_Image.color; FindRadarCenter(); CalculatePosition(); switch (m_CurrentType) { case eMapPointType.FISH: FishAI fish = target.GetComponent <FishAI>(); fish.OnSpawn += ShowPoint; fish.OnDeath += HidePoint; break; case eMapPointType.PATROL: PatrolAI patrol = target.GetComponent <PatrolAI>(); patrol.OnSpawn += ShowPoint; patrol.OnDeath += HidePoint; break; case eMapPointType.FISHVARIANT: FishVariantAI fishVariant = target.GetComponent <FishVariantAI>(); fishVariant.OnSpawn += ShowPoint; fishVariant.OnDeath += HidePoint; break; case eMapPointType.TANK: TankAI tank = target.GetComponent <TankAI>(); tank.OnSpawn += ShowPoint; tank.OnDeath += HidePoint; break; } UIPanelRadar.Instance.UpdatePoint += UpdatePosition; }
public void AddPoint(GameObject target, eMapPointType type) { m_Map.AddPointPrefab(target, type); }
public void AddMapPoint(GameObject target, eMapPointType type) { m_PanelMissionBriefing.AddPoint(target, type); m_PanelMap.AddPointPrefab(target, type); }
public void AddRadarPoint(GameObject target, eMapPointType type) { m_PanelRadar.AddPointPrefab(target, type); }