This commit is contained in:
dhain 2022-05-19 16:13:53 +02:00
parent 7a04d79aba
commit 470aeff3f3
4 changed files with 3659 additions and 3 deletions

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,8 @@ using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using Cursor = UnityEngine.Cursor;
public class PlayerController : MonoBehaviour {
#region Singleton
@ -40,4 +42,8 @@ public class PlayerController : MonoBehaviour {
Debug.Log("An item requested to select isn't in the inventory" + item);
}
}
public UsableItem GetSelectedItem() {
return selectedItem;
}
}

View file

@ -24,7 +24,7 @@ public class TileBehaviour : MonoBehaviour
void OnMouseDown()
{
Debug.Log("Clicked");
UsableItem usable = PlayerController.getInstance().SelectedItem;
UsableItem usable = PlayerController.instance.GetSelectedItem();
BaseTile tileToSetTo = null;
if (usable.GetType() == typeof(TerraformingTool))
{

View file

@ -17,7 +17,7 @@ namespace Tiles
public new BaseTile Clicked(UsableItem usable) {
base.Clicked(usable);
BaseTile rv = null;
if (usable.GetType() == typeof(Items.Hoe))
if (usable.displayName == "Hoe")
{
rv = new FarmlandTile();
}