34 lines
912 B
C#
34 lines
912 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class RoomManager : MonoBehaviour
|
|
{
|
|
public RoomPrefs myRoom;
|
|
public List<GameObject> doors;
|
|
public List<GameObject> furnitures;
|
|
public List<GameObject> portals;
|
|
public List<GameObject> enemies;
|
|
|
|
public void Awake()
|
|
{
|
|
if (!myRoom.doors && myRoom.furniture && !myRoom.portals && !myRoom.enemies) return;
|
|
if (myRoom.doors)
|
|
{
|
|
foreach (GameObject door in doors) door.SetActive(true);
|
|
}
|
|
if (!myRoom.furniture)
|
|
{
|
|
foreach(GameObject f in furnitures) f.SetActive(false);
|
|
}
|
|
if (myRoom.portals)
|
|
{
|
|
foreach(GameObject portal in portals) portal.SetActive(true);
|
|
}
|
|
if (myRoom.enemies)
|
|
{
|
|
foreach ( GameObject enemy in enemies) enemy.SetActive(true);
|
|
}
|
|
}
|
|
}
|