public void RightMouseUpdate() { if (Input.GetMouseButtonDown(1)) { RaycastHit hit; Ray ray = FindObjectOfType <Camera>().ScreenPointToRay(Input.mousePosition); if (!Physics.Raycast(ray, out hit, 1000, Mask)) { return; } Transform objectHit = hit.transform; if (objectHit.TryGetComponent(out Cell cell)) { if (!cell.IsFree) { return; } RightClickEvent?.Invoke(); cell.SpawnFoundation(); } } }
public override void OnPointerClick(PointerEventData eventData) { image.color = Color.cyan; if (eventData.clickCount == 1 && eventData.button == PointerEventData.InputButton.Right) { info.CurrentSelectedContainer = inputField.text; RightClickEvent.Raise(); } if (eventData.clickCount == 2 && eventData.button == PointerEventData.InputButton.Left) { info.Container = inputField.text; info.AbsolutePath = path; fileEvent.Raise(); } }
public void Execute() { if (Finished) { return; } WowGameobject lootableObject = WowInterface.ObjectManager.WowObjects.OfType <WowGameobject>() .Where(e => e.DisplayId == ObjectDisplayId) .OrderBy(e => e.Position.GetDistance(WowInterface.ObjectManager.Player.Position)) .FirstOrDefault(); if (lootableObject != null) { if (lootableObject.Position.GetDistance(WowInterface.ObjectManager.Player.Position) > 3.0) { WowInterface.MovementEngine.SetMovementAction(MovementAction.Moving, lootableObject.Position); } else { if (RightClickEvent.Run()) { WowInterface.MovementEngine.Reset(); WowInterface.HookManager.WowStopClickToMove(); WowInterface.HookManager.WowObjectRightClick(lootableObject); } } } else { AreaNode selectedArea = Area .OrderBy(e => e.Position.GetDistance(WowInterface.ObjectManager.Player.Position)) .FirstOrDefault(e => e.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < e.Radius); if (selectedArea != null) { WowInterface.MovementEngine.SetMovementAction(MovementAction.Moving, selectedArea.Position); } } }
public void Execute() { if (Finished) { return; } IWowGameobject lootableObject = Bot.Objects.WowObjects.OfType <IWowGameobject>() .Where(e => e.DisplayId == ObjectDisplayId) .OrderBy(e => e.Position.GetDistance(Bot.Player.Position)) .FirstOrDefault(); if (lootableObject != null) { if (lootableObject.Position.GetDistance(Bot.Player.Position) > 3.0) { Bot.Movement.SetMovementAction(MovementAction.Move, lootableObject.Position); } else { if (RightClickEvent.Run()) { Bot.Movement.Reset(); Bot.Wow.StopClickToMove(); Bot.Wow.InteractWithObject(lootableObject.BaseAddress); } } } else { AreaNode selectedArea = Area .OrderBy(e => e.Position.GetDistance(Bot.Player.Position)) .FirstOrDefault(e => e.Position.GetDistance(Bot.Player.Position) < e.Radius); if (selectedArea != null) { Bot.Movement.SetMovementAction(MovementAction.Move, selectedArea.Position); } } }
/// <summary> /// Activates the RightClickEvent /// </summary> /// <param name="e">Event args</param> protected virtual void FireRightClickEvent(EventArgs e) { RightClickEvent?.Invoke(this, e); }
public void RightClick(object sender, MouseButtonEventArgs args) { RightClickEvent?.Invoke(sender, args); }