public void OnPointerClick(PointerEventData eventData)
 {
     if (pickup.CanBePickedUp())
     {
         int number = pickup.PickupItem();
         inventory.RemoveFromSlot(index, number);
     }
 }
예제 #2
0
 public CursorType GetCursorType()
 {
     if (pickup.CanBePickedUp())
     {
         return(CursorType.Pickup);
     }
     else
     {
         return(CursorType.FullPickup);
     }
 }
예제 #3
0
        Pickup m_Pickup;            //Reference to the pickup object

        ///////////////////////////// INTERFACES ////////////////////////////////////////////

        /// <summary>
        /// Display the appropriate cursor type based upon inventory state
        /// </summary>
        /// <returns></returns>
        public CursorType GetCursorType()
        {
            if (m_Pickup.CanBePickedUp())
            {
                return(CursorType.Pickup);
            }
            else
            {
                return(CursorType.FullInventory);
            }
        }
예제 #4
0
 CursorType IRaycastable.GetCursorType()
 {
     if (pickup.CanBePickedUp())
     {
         return(CursorType.Pickup);
     }
     else
     {
         return(CursorType.FullPickup);
     }
 }
예제 #5
0
        public bool IsRaycastHit(out CursorType cursorType, out RaycastableType raycastableType)
        {
            if (_pickup.CanBePickedUp())
            {
                cursorType = CursorType.Pickup;
            }
            else
            {
                cursorType = CursorType.FullPickup;
            }

            raycastableType = RaycastableType.ProximityPickup;
            return(true);
        }
예제 #6
0
        public bool IsRaycastHit(out CursorType cursorType, out RaycastableType raycastableType)
        {
            if (_pickup.CanBePickedUp())
            {
                cursorType = CursorType.Pickup;
            }
            else
            {
                cursorType = CursorType.FullPickup;
            }

            raycastableType = RaycastableType.ClickablePickup;

            if (Input.GetMouseButtonDown(0))
            {
                _pickup.PickupItem();
            }

            return(true);
        }