void Mouse_OnEnterUnoccupiedCell(ConstructionPoint cell) { // If a cell is under the mouse, highlight it and move the ghost object to the construction point's position. cell.Highlight(); ghost.Position = cell.Position + Vec3.Up * ghostHeight; ghost.Show(); }
public ConstructionPointController(Vec3 position, Quat rotation, int size, ConstructionPoint view) { Position = position; Rotation = rotation; Size = size; this.view = view; this.view.Controller = this; }
void OnLeftButtonDown(int x, int y) { if (mouseController.Current == null) { return; } previousSelection = Selection; Selection = mouseController.Current; if (!mouseController.CanSelect()) { // Fire the Select event if the clicked object is the same as the previous one if (Selection == previousSelection) { InvokeSelect(); } } else { InvokeSelect(); } }
void OnRightButtonDown(int x, int y) { Selection = null; SelectionCleared?.Invoke(); }
public InputEvent(ConstructionPoint selection, bool changed = false) { Selection = selection; SelectionChanged = changed; }
void MouseController_OnEnterOccupiedCell(ConstructionPoint cell) { // If the mouse is over a construction point occupied by a tower, remove the highlight and hide the ghost object. cell.RemoveHighlight(); ghost.Hide(); }