private void UsePickup() { GameObject pickupObject = Resources.Load <GameObject>("Drops/" + inventoryArray[selectedSlotID].ToString()); BasePickup basePickup = pickupObject.GetComponent <BasePickup>(); basePickup.UsePickup(); }
public bool PickupCollectable() { if (targetObject != null) { BasePickup pickup = targetObject.GetComponent <BasePickup>(); if (pickup != null) { Pickup(pickup); return(true); } } return(false); }
public void Pickup(BasePickup pickup) { pickup.Pickup(this); }