Created
May 10, 2021 06:02
-
-
Save Matthew-J-Spencer/693c1e26fed7fcfe921faf134161d9f6 to your computer and use it in GitHub Desktop.
Tile.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Tile : MonoBehaviour { | |
[SerializeField] private Color _baseColor, _offsetColor; | |
[SerializeField] private SpriteRenderer _renderer; | |
[SerializeField] private GameObject _highlight; | |
public void Init(bool isOffset) { | |
_renderer.color = isOffset ? _offsetColor : _baseColor; | |
} | |
void OnMouseEnter() { | |
_highlight.SetActive(true); | |
} | |
void OnMouseExit() | |
{ | |
_highlight.SetActive(false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment