public void Show(ClientParty party, ClientTile tile) { if (party.Tile == tile || tile == null) { Hide(); return; } var pos = Camera.main.WorldToScreenPoint(tile.GetGameObject().transform.position); _gameObject.transform.position = pos; _gameObject.SetActive(true); var actions = new List <EntityAction>(); if (tile.StaticEntity is ClientDungeon) { actions.Add(EntityAction.CHECK); actions.Add(EntityAction.ATTACK); } else { actions.Add(EntityAction.MOVE); } actions.Add(EntityAction.GUARD); BuildActions(actions.ToArray()); }
internal void Add(ClientTile tile, params GameObject [] pathLines) { if (!_pathLines.ContainsKey(tile)) { _pathLines[tile] = new List <GameObject>(); } _pathLines[tile].AddRange(pathLines); }
private void CameraMove(Vector3 old, Vector3 newPos) { if (IsActive(_tileCursor)) { Inactivate(_tileCursor); } _selectedTile = null; }
public void StartMoveReq(ClientParty party, List <ClientTile> path) { if (IsActive(_tileCursor)) { Inactivate(_tileCursor); } _selectedTile = null; }
public void OnClickTile(ClientTile tile) { /* * var dungeon = tile.StaticEntity as ClientDungeon; * if (dungeon == null) return; * UIManager.DungeonsUI.Display(dungeon); */ }
private void OnClickTile(ClientTile tile) { Log.Debug("Actions click tile"); if (UIManager.PartyUI.HasSelectedParty) { Show(UIManager.PartyUI.SelectedParty, tile); } }
public static void FocusOnTile(ClientTile t) { Log.Debug($"Focusing on tile {t}"); var camera = Get(); var coroutine = camera.LerpFromTo(camera.transform.position, new Vector3(t.X - 2, 5, t.Y - 2), 0.2f); camera.StartCoroutine(coroutine); }
private void MoveToSelectedTile(MovementIntent intent) { ClientParty party = UIManager.PartyUI.SelectedParty; ClientTile selectedTile = UIManager.TileUI.SelectedTile; Log.Debug($"Moving {party} to {selectedTile}"); var map = selectedTile.Chunk.Map; var path = map.FindPath(party.Tile, selectedTile); var tilePath = path.Select(node => (ClientTile)map.GetTile(node.X, node.Y)).ToList(); ClientEvents.StartMovementRequest(party, tilePath); MainBehaviour.Networking.Send(new MoveRequestEvent() { PartyIndex = party.PartyIndex, Path = path.Select(p => new Game.World.Position(p.X, p.Y)).ToList(), Intent = intent }); }
public static void ActionSelected(ClientParty p, ClientTile tile, EntityAction action) { OnActionSelected?.Invoke(p, tile, action); }
public static void PartyFinishedMove(ClientParty p, ClientTile o, ClientTile n) { OnPartyFinishedMove?.Invoke(p, o, n); }
public static void ClickTile(ClientTile tile) { OnClickTile?.Invoke(tile); }