Merge branch 'develop' into sprechtl

This commit is contained in:
s-prechtl 2022-06-03 15:00:08 +02:00
commit 8608ffd2eb
2 changed files with 5 additions and 7 deletions

View file

@ -10,8 +10,8 @@ public class TileBehaviour : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
_hoverIndicatorSpriteRenderer = gameObject.transform.GetChild(0).GetComponent<SpriteRenderer>(); //_hoverIndicatorSpriteRenderer = gameObject.transform.GetChild(0).GetComponent<SpriteRenderer>();
SetHoverIndicatorVisibility(false); //SetHoverIndicatorVisibility(false);
SetTile(new GrassTile()); SetTile(new GrassTile());
HouseController.NewDayEvent.AddListener(_tile.DayLightStep); HouseController.NewDayEvent.AddListener(_tile.DayLightStep);
@ -49,14 +49,12 @@ public class TileBehaviour : MonoBehaviour
private void OnMouseEnter() private void OnMouseEnter()
{ {
Debug.Log("rein"); //SetHoverIndicatorVisibility(true);
SetHoverIndicatorVisibility(true);
} }
private void OnMouseExit() private void OnMouseExit()
{ {
Debug.Log("raus"); //SetHoverIndicatorVisibility(false);
SetHoverIndicatorVisibility(false);
} }
private void SetHoverIndicatorVisibility(bool visible) private void SetHoverIndicatorVisibility(bool visible)

View file

@ -37,7 +37,7 @@ namespace Tiles
static protected Sprite GenerateSpriteFromFile(String pathToImageFile) static protected Sprite GenerateSpriteFromFile(String pathToImageFile)
{ {
byte[] data = System.IO.File.ReadAllBytes(pathToImageFile); byte[] data = File.ReadAllBytes(pathToImageFile);
Texture2D texture = new Texture2D(32, 32, TextureFormat.ARGB32, false); Texture2D texture = new Texture2D(32, 32, TextureFormat.ARGB32, false);
texture.LoadImage(data); texture.LoadImage(data);
Sprite sprite = Sprite.Create(texture, new Rect(0.0f, 0.0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), 32); Sprite sprite = Sprite.Create(texture, new Rect(0.0f, 0.0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), 32);