private void GenerateIconViews() { EventHandler value = new EventHandler(MapIcon_MouseClick); EventHandler <XEventArgs <Boolean> > value2 = new EventHandler <XEventArgs <Boolean> >(MapIcon_MouseTooltip); foreach (WorldMapIcon worldMapIcon in m_Icons) { if (worldMapIcon != null) { worldMapIcon.MouseClick -= value; worldMapIcon.MouseTooltip -= value2; Destroy(worldMapIcon.gameObject); } } m_Icons.Clear(); IEnumerable <WorldMapPoint> enumerable = LegacyLogic.Instance.WorldManager.WorldMapController.WorldMapPointsIterator(); foreach (WorldMapPoint worldMapPoint in enumerable) { WorldMapIcon worldMapIcon2 = Helper.Instantiate <WorldMapIcon>(m_IconPrefab); worldMapIcon2.transform.parent = m_IconOrigin.transform; worldMapIcon2.transform.localRotation = Quaternion.identity; worldMapIcon2.transform.localScale = Vector3.one; worldMapIcon2.transform.localPosition = GetWorldMapPosition(worldMapPoint.StaticData.Position); worldMapIcon2.MouseClick += value; worldMapIcon2.MouseTooltip += value2; worldMapIcon2.Initialize(this, worldMapPoint); m_Icons.Add(worldMapIcon2); } }
private void MapIcon_MouseTooltip(Object sender, XEventArgs <Boolean> e) { WorldMapIcon worldMapIcon = (WorldMapIcon)sender; if (e.Value) { TooltipManager.Instance.Show(this, LocaManager.GetText(worldMapIcon.Data.StaticData.NameKey), m_UserMapNoteController.GetUserMapNoteText(Input.mousePosition), worldMapIcon.transform.position, new Vector3(24f, 24f, 0f)); } else { TooltipManager.Instance.Hide(this); } }