This commit is contained in:
dhain 2022-05-19 16:54:36 +02:00
parent 66eb5af0bb
commit 97b6ce7497
7 changed files with 3 additions and 56 deletions

View file

@ -1,6 +1,7 @@
using System;
using UnityEngine;
[CreateAssetMenu(fileName = "New Item", menuName = "Inventory/Item")]
public class Item : ScriptableObject, IComparable<Item> {
public string displayName;
public string description;

View file

@ -38,7 +38,7 @@ public class PlayerController : MonoBehaviour {
public void SetSelectedItem(UsableItem item) {
if(_inventory.items.ContainsKey(item)) {
selectedItem = item;
Cursor.SetCursor(item.defaultSprite.texture, Vector2.zero, CursorMode.Auto);
Cursor.SetCursor(item.selectedSprite.texture, Vector2.zero, CursorMode.Auto);
} else {
Debug.Log("An item requested to select isn't in the inventory" + item);
}

View file

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "New UsableItem", menuName = "Inventory/UsableItem")]
public class UsableItem : Item, IUsable {
// Start is called before the first frame update
void Start() {