Added roll dice button
This commit is contained in:
parent
d04624edfd
commit
dbef10d80a
10 changed files with 472 additions and 82 deletions
|
|
@ -13,6 +13,8 @@ public class Room : MonoBehaviour
|
|||
public event EventHandler<Room> ValidRoomClicked;
|
||||
|
||||
bool _isExplored = false;
|
||||
|
||||
private Color _roomNumberOriginalColor;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start() {
|
||||
|
|
@ -28,10 +30,22 @@ public class Room : MonoBehaviour
|
|||
|
||||
public void SetRoomExplored() {
|
||||
_isExplored = true;
|
||||
UnhighlightRoomAsOption();
|
||||
gameObject.GetComponent<SpriteRenderer>().color =
|
||||
ColorHelper.AddColorTint(gameObject.GetComponent<SpriteRenderer>().color, Color.grey, 0.5f);
|
||||
}
|
||||
|
||||
public void HighlightRoomAsOption()
|
||||
{
|
||||
_roomNumberOriginalColor = gameObject.GetComponentInChildren<TextMeshProUGUI>().color;
|
||||
gameObject.GetComponentInChildren<TextMeshProUGUI>().color = Color.blue;
|
||||
}
|
||||
|
||||
public void UnhighlightRoomAsOption()
|
||||
{
|
||||
gameObject.GetComponentInChildren<TextMeshProUGUI>().color = _roomNumberOriginalColor;
|
||||
}
|
||||
|
||||
void SetPropertiesOfEntrance() {
|
||||
gameObject.GetComponent<SpriteRenderer>().color = Color.green;
|
||||
isEntrance = true;
|
||||
|
|
@ -50,7 +64,7 @@ public class Room : MonoBehaviour
|
|||
}
|
||||
|
||||
// Check if the room is valid to be explored. If so trigger the event.
|
||||
bool IsValidRoomToExplore() {
|
||||
public bool IsValidRoomToExplore() {
|
||||
if (_isExplored) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue