示例#1
0
    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 bool IsUnderFloorTile(GameObject obj)
    {
        LayerTile tile = UITileList.GetTileAtPosition(obj.WorldPosClient());

        // Layer 22 is the 'Floor' layer
        return(tile != null && tile.LayerType != LayerType.Base && obj.layer == 22);
    }
示例#3
0
    private bool IsUnderFloorTile(GameObject obj)
    {
        LayerTile tile = UITileList.GetTileAtPosition(obj.WorldPos());

        if (tile.LayerType != LayerType.Base && obj.layer < 1)
        {
            return(true);
        }
        return(false);
    }
 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);
         }
     }
 }
示例#5
0
    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();
            }
        }