public String GetUserMapNoteText(Vector3 mousePosition) { Vector3 position = UICamera.currentCamera.ScreenToWorldPoint(mousePosition); position = transform.InverseTransformPoint(position) + new Vector3(6f, 6f, 0f); Position worldMapGridPosition = WorldMapController.GetWorldMapGridPosition(position); MapNote mapNote = LegacyLogic.Instance.WorldManager.MapNotesController.FindMapNote("theworld.xml", worldMapGridPosition); return((mapNote == null) ? null : mapNote.Note); }
public void OnClick() { Vector3 position = UICamera.currentCamera.ScreenToWorldPoint(Input.mousePosition); position = transform.InverseTransformPoint(position) + new Vector3(6f, 6f, 0f); m_CurrentSelectedGridPosition = WorldMapController.GetWorldMapGridPosition(position); MapNote mapNote = LegacyLogic.Instance.WorldManager.MapNotesController.GetMapNote("theworld.xml", m_CurrentSelectedGridPosition); PopupRequest.Instance.OpenRequest(PopupRequest.ERequestType.MAP_NOTES, String.Empty, null, new PopupRequest.RequestCallback(OnRequestCallback)); PopupRequest.Instance.InputAreaText = mapNote.Note; }
private void CreateMapNoteView(MapNote note) { GameObject gameObject = Helper.Instantiate <GameObject>(m_MapNotePrefab); gameObject.transform.parent = transform; gameObject.transform.localPosition = WorldMapController.GetWorldMapPosition(note.Position); gameObject.GetComponent <UIWidget>().MakePixelPerfect(); WorldMapUserMapNoteView component = gameObject.GetComponent <WorldMapUserMapNoteView>(); component.MapNote = note; component.MouseClick += NodeView_MouseClick; m_ActiveNotes.Add(note.Position, component); }
private void UpdateIconPosition(Boolean skipAnimation) { Position position; if (GetPlayerPosition(out position)) { gameObject.SetActive(true); Vector3 worldMapPosition = WorldMapController.GetWorldMapPosition(position); worldMapPosition.z = -2f; if (skipAnimation) { TweenPosition.Begin(gameObject, 0f, worldMapPosition); } else { TweenPosition.Begin(gameObject, m_MoveTime, worldMapPosition); } } else { gameObject.SetActive(false); } }
private void OnSpiritBeaconUpdate(Object sender, EventArgs e) { gameObject.SetActive(LegacyLogic.Instance.WorldManager.SpiritBeaconController.Existent); SpiritBeaconPosition spiritBeacon = LegacyLogic.Instance.WorldManager.SpiritBeaconController.SpiritBeacon; Vector3 worldMapPosition; if (spiritBeacon.MapPointID != 0) { WorldMapPoint worldMapPoint = LegacyLogic.Instance.WorldManager.WorldMapController.FindWorldMapPoint(spiritBeacon.MapPointID); if (worldMapPoint == null) { Debug.LogError("Beacon mappoint position not found! ID: " + spiritBeacon.MapPointID); gameObject.SetActive(false); return; } worldMapPosition = WorldMapController.GetWorldMapPosition(worldMapPoint.StaticData.Position); } else { worldMapPosition = WorldMapController.GetWorldMapPosition(spiritBeacon.Position); } worldMapPosition.z = -1f; transform.localPosition = worldMapPosition; }
private void OnDestroy() { m_controller = null; m_data = null; }
public void Initialize(WorldMapController p_controller, WorldMapPoint p_data) { m_controller = p_controller; m_data = p_data; UpdateIcon(); }