UsableItem.cs
This commit is contained in:
parent
22f8a3b9e5
commit
d84a815d74
3 changed files with 47 additions and 18 deletions
|
|
@ -2,18 +2,37 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
public class PlayerController : MonoBehaviour {
|
||||
private List<Item> inventory;
|
||||
private int money;
|
||||
private UsableItem selectedItem;
|
||||
|
||||
private static PlayerController instance;
|
||||
|
||||
public int startMoney = 100;
|
||||
|
||||
public static PlayerController getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
inventory ??= new List<Item>();
|
||||
money = startMoney;
|
||||
instance = this;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void setSelectedItem(UsableItem item) {
|
||||
selectedItem = item;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
25
Assets/Scripts/UsableItem.cs
Normal file
25
Assets/Scripts/UsableItem.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UsableItem : Item, IUsable
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public UsableItem(string displayName, string description, int id) : base(displayName, description, id) {
|
||||
}
|
||||
|
||||
public void select() {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue