created Items
created IUsable.cs interface
This commit is contained in:
parent
ca0718d286
commit
26ea595bfa
15 changed files with 297 additions and 0 deletions
17
Assets/Scripts/Item.cs
Normal file
17
Assets/Scripts/Item.cs
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue