CultivationOfBrewing-2/Assets/Scripts/CXX/Devices///DoorGroup.cs

30 lines
568 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoorGroup : MonoBehaviour
{
public Door[] doors;
// Start is called before the first frame update
void Start()
{
doors = GetComponentsInChildren<Door>();
}
public void OpenOrClose()
{
for (int i = 0; i < doors.Length; i++)
{
doors[i].CanOpen();
}
}
public void SetAllDoorState(bool isOpen)
{
foreach (var item in doors)
{
item.SetState(isOpen);
}
}
}