public void OnMouseButton(Vector3 mousePosition, StateInformation stateInformation) { if (leftMouseButton.GetState() == MouseButtonState.PRESSED || leftMouseButton.GetState() == MouseButtonState.DOWN) { objectDeletionModule.DeleteObject(stateInformation.hoveredObject); stateInformation.hoveredObject = null; } }
private void HandleLeftMouseButton() { if (leftMouseButton.GetState() != MouseButtonState.NONE && !interfaceManager.MouseOverUIElement) { if (state == null) { return; } state.OnMouseButton(mousePosition, stateInformation); } }
public void OnMouseButton(Vector3 mousePosition, StateInformation stateInformation) { if (leftMouseButton.GetState() == MouseButtonState.PRESSED && stateInformation.objectToPlace.Type == PrefabType.LEVELELEMENT) { objectPlacementModule.PlaceObject(stateInformation.objectToPlace, mousePosition); } else if (leftMouseButton.GetState() == MouseButtonState.DOWN) { objectPlacementModule.PlaceObject(stateInformation.objectToPlace, mousePosition); } }
public void OnMouseButton(Vector3 mousePosition, StateInformation stateInformation) { IPlacedObject selectedObject = stateInformation.selectedObject; MouseButtonState leftMouseButtonState = leftMouseButton.GetState(); // moving the Object if (leftMouseButtonState == MouseButtonState.DOWN) { selectedObject.SetAllCollidersStatus(false); } else if (leftMouseButtonState == MouseButtonState.PRESSED) { selectedObject.RemoveWeaponFromPerson(); //selectedObject.SetAllCollidersStatus(false); objectEditingModule.MoveObject(selectedObject, mousePosition); } else if (leftMouseButtonState == MouseButtonState.UP) { selectedObject.SetAllCollidersStatus(true); } // Giving an Enemy a Weapon if (leftMouseButtonState == MouseButtonState.UP && lastLeftMouseButtonState == MouseButtonState.PRESSED) { IPlacedObject hoveredObject = stateInformation.hoveredObject; bool objectCanBeGiven = objectInformationModule.CheckIfWeaponCanBeGivenToPerson(selectedObject, hoveredObject); if (objectCanBeGiven) { // give selectedObject to hoveredObject objectEditingModule.GiveWeaponToPerson(selectedObject, hoveredObject); } } lastLeftMouseButtonState = leftMouseButtonState; }
public void OnMouseButton(Vector3 mousePosition, StateInformation stateInformation) { if (leftMouseButton.GetState() == MouseButtonState.DOWN) { objectEditingModule.AddPatrolPoint(stateInformation.selectedObject, mousePosition); interfaceManager.SetupObjectEditorPanel(stateInformation.selectedObject); } }
private bool CheckForRightMouseClick() { if (rightMouseButton.GetState() == MouseButtonState.CLICKED) { return(true); } return(false); }