added Player GameObject, updated GrassTile.Clicked()
This commit is contained in:
parent
433158e658
commit
4612938b54
5 changed files with 76 additions and 5 deletions
|
|
@ -24,12 +24,18 @@ public class TileBehaviour : MonoBehaviour
|
|||
void OnMouseDown()
|
||||
{
|
||||
Debug.Log("Clicked");
|
||||
tile.Clicked(/* Current tool */ null);
|
||||
|
||||
// SelectedItem always null for now
|
||||
BaseTile temp = tile.Clicked(PlayerController.getInstance().SelectedItem);
|
||||
if (temp != null)
|
||||
{
|
||||
SetTile(temp);
|
||||
}
|
||||
}
|
||||
|
||||
void SetTile(BaseTile tileToSet)
|
||||
{
|
||||
tile = tileToSet;
|
||||
GetComponent<SpriteRenderer>().color = tile.getColor;
|
||||
GetComponent<SpriteRenderer>().color = tile.getColor; // TODO: Change to Sprite
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue