can interact if player has tool selected (in hand))

This commit is contained in:
j.mei7
2022-02-18 20:25:35 +01:00
parent 73669eaa3f
commit 3ff90d47c2
30 changed files with 505 additions and 78 deletions

View File

@@ -3,10 +3,19 @@ using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "Item", menuName = "Items/Item", order = 1)]
public class Item : ScriptableObject
public abstract class Item : ScriptableObject
{
public new string name;
public int id;
public bool isStackable;
public Sprite sprite;
public bool isSelected;
public abstract void OnSelect();
public void Select()
{
isSelected = !isSelected;
OnSelect();
}
}