added Tiles, basic TileBehaviour

This commit is contained in:
j-weissen 2022-05-18 22:53:23 +02:00
parent 66756be23b
commit 433158e658
8 changed files with 100 additions and 7 deletions

View file

@ -0,0 +1,35 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Tiles;
using UnityEngine;
public class TileBehaviour : MonoBehaviour
{
private BaseTile tile;
// Start is called before the first frame update
void Start()
{
Debug.Log("Created");
SetTile(new GrassTile());
}
// Update is called once per frame
void Update()
{
}
void OnMouseDown()
{
Debug.Log("Clicked");
tile.Clicked(/* Current tool */ null);
}
void SetTile(BaseTile tileToSet)
{
tile = tileToSet;
GetComponent<SpriteRenderer>().color = tile.getColor;
}
}