private bool CheckAltClick() { if (KeyboardInputManager.IsAltPressed()) { //Check for items on the clicked position, and display them in the Item List Tab, if they're in reach //and not FOV occluded Vector3 position = MouseWorldPosition; position.z = 0f; if (!lightingSystem.enabled || lightingSystem.IsScreenPointVisible(CommonInput.mousePosition)) { if (PlayerManager.LocalPlayerScript.IsInReach(position, false)) { List <GameObject> objects = UITileList.GetItemsAtPosition(position); //remove hidden wallmounts objects.RemoveAll(obj => obj.GetComponent <WallmountBehavior>() != null && obj.GetComponent <WallmountBehavior>().IsHiddenFromLocalPlayer()); LayerTile tile = UITileList.GetTileAtPosition(position); ControlTabs.ShowItemListTab(objects, tile, position); } } UIManager.SetToolTip = $"clicked position: {Vector3Int.RoundToInt(position)}"; return(true); } return(false); }
private void CheckAltClick() { if (Input.GetMouseButtonDown(0) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt))) { //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach var position = Camera.main.ScreenToWorldPoint(Input.mousePosition); if (PlayerManager.LocalPlayerScript.IsInReach(position)) { List <GameObject> tiles = UITileList.GetItemsAtPosition(position); ControlTabs.ShowItemListTab(tiles); } } }
private void CheckAltClick() { if (UnityEngine.Input.GetMouseButtonDown(0) && (UnityEngine.Input.GetKey(KeyCode.LeftAlt) || UnityEngine.Input.GetKey(KeyCode.RightAlt))) { //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach Vector3 position = Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition); position.z = 0f; if (PlayerManager.LocalPlayerScript.IsInReach(position)) { List <GameObject> objects = UITileList.GetItemsAtPosition(position); LayerTile tile = UITileList.GetTileAtPosition(position); ControlTabs.ShowItemListTab(objects, tile, position); } } }
private bool CheckAltClick() { if (UnityEngine.Input.GetKey(KeyCode.LeftAlt) || UnityEngine.Input.GetKey(KeyCode.RightAlt)) { //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach Vector3 position = Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition); position.z = 0f; if (PlayerManager.LocalPlayerScript.IsInReach(position)) { List <GameObject> objects = UITileList.GetItemsAtPosition(position); LayerTile tile = UITileList.GetTileAtPosition(position); ControlTabs.ShowItemListTab(objects, tile, position); } UIManager.SetToolTip = $"clicked position: {Vector3Int.RoundToInt(position)}"; return(true); } return(false); }
private void CheckAltClick() { Event e = Event.current; if (e.type != EventType.Used && e.button == 0 && (UnityEngine.Input.GetKey(KeyCode.LeftAlt) || UnityEngine.Input.GetKey(KeyCode.RightAlt))) { //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach Vector3 position = Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition); position.z = 0f; if (PlayerManager.LocalPlayerScript.IsInReach(position)) { List <GameObject> objects = UITileList.GetItemsAtPosition(position); LayerTile tile = UITileList.GetTileAtPosition(position); ControlTabs.ShowItemListTab(objects, tile, position); } UIManager.SetToolTip = $"clicked position: {Vector3Int.RoundToInt(position)}"; e.Use(); } }