created Items

created IUsable.cs interface
This commit is contained in:
dhain 2022-05-09 23:06:01 +02:00
parent ca0718d286
commit 26ea595bfa
15 changed files with 297 additions and 0 deletions

17
Assets/Scripts/Item.cs Normal file
View file

@ -0,0 +1,17 @@
using UnityEngine;
public class Item : MonoBehaviour {
private string displayName;
private string description;
private int id;
public SpriteRenderer spriteRenderer;
public Sprite selectedSprite;
public Sprite defaultSprite;
public Item(string displayName, string description, int id) {
this.displayName = displayName;
this.description = description;
this.id = id;
spriteRenderer.sprite = defaultSprite; // defaultSprite is set in UnityEditor
}
}