Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # Assets/Scripts/PlayerController.cs
This commit is contained in:
commit
66756be23b
1 changed files with 17 additions and 8 deletions
|
|
@ -1,33 +1,42 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerController : MonoBehaviour {
|
||||
private List<Item> inventory;
|
||||
private Dictionary<Item, int> 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>();
|
||||
void Start()
|
||||
{
|
||||
inventory ??= new Dictionary<Item, int>();
|
||||
money = startMoney;
|
||||
instance = this;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void setSelectedItem(UsableItem item) {
|
||||
selectedItem = item;
|
||||
if (inventory.ContainsKey(item)) {
|
||||
selectedItem = item;
|
||||
Cursor.SetCursor(item.defaultSprite.texture, Vector2.zero, CursorMode.Auto);
|
||||
} else {
|
||||
Debug.Log("An item requested to select isn't in the inventory" + item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue