Пример #1
0
 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();
 }
Пример #2
0
 public ConstructionPointController(Vec3 position, Quat rotation, int size, ConstructionPoint view)
 {
     Position             = position;
     Rotation             = rotation;
     Size                 = size;
     this.view            = view;
     this.view.Controller = this;
 }
Пример #3
0
        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();
            }
        }
Пример #4
0
 void OnRightButtonDown(int x, int y)
 {
     Selection = null;
     SelectionCleared?.Invoke();
 }
Пример #5
0
 public InputEvent(ConstructionPoint selection, bool changed = false)
 {
     Selection        = selection;
     SelectionChanged = changed;
 }
Пример #6
0
 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();
 }