36 lines
879 B
C#
36 lines
879 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
|
|
public class Room : MonoBehaviour
|
|
{
|
|
public int number;
|
|
public GameObject numberTextObject;
|
|
public List<GameObject> adjacentRooms;
|
|
public bool isEntrance;
|
|
private bool isExplored = false;
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
if (isEntrance)
|
|
{
|
|
SetPropertiesOfEntrance();
|
|
}
|
|
|
|
TextMeshProUGUI numberText = numberTextObject.GetComponent<TextMeshProUGUI>();
|
|
numberText.SetText(number.ToString());
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
private void SetPropertiesOfEntrance()
|
|
{
|
|
this.gameObject.GetComponent<SpriteRenderer>().color = Color.green;
|
|
this.isEntrance = true;
|
|
}
|
|
}
|