Clickable Pickup Script

So, the Clickable pickup script is missing from the inventory.zip file. Below is the script for those who need it

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GameDevTV.Inventories;

namespace RPG.Control
{
    [RequireComponent(typeof(Pickup))]
    public class ClickablePickup : MonoBehaviour, IRaycastable
    {
        Pickup pickup;

        private void Awake()
        {
            pickup = GetComponent<Pickup>();
        }

        public CursorType GetCursorType()
        {
            if (pickup.CanBePickedUp())
            {
                return CursorType.Pickup;
            }
            else
            {
                return CursorType.FullPickup;
            }
        }

        public bool HandleRaycast(PlayerAttackingStateController callingController)
        {
            if (Input.GetMouseButton(0))
            {
                pickup.PickupItem();

            }
            return true;
        }
    }
}
2 Likes

Thank you! This being missing was actually quite infuriating. I was about to type it all from scratch pausing and unpausing the few seconds it was on the screen, so I really appreciate you sharing this.

@Rick_Davidson you really need to update the .zip to fix this missing script.

my hero

the entire course needs an overhaul. Brian’s conversion though seems very promising, and it’s opening a ton of new doors I didn’t know were possible (lowkey enjoying it tbh)

Privacy & Terms