2024-03-03 10:55:46 +00:00
|
|
|
using System;
|
2024-02-11 05:21:29 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class Restaurant : MonoBehaviour
|
|
|
|
{
|
2024-03-03 10:55:46 +00:00
|
|
|
public Transform restaurantSwitch;
|
|
|
|
private bool isSwitchOn = false;
|
2024-03-03 14:04:28 +00:00
|
|
|
public Transform mainDoor;
|
|
|
|
public Transform[] guestNpc;
|
|
|
|
public GameObject[] mainLight;
|
2024-02-11 05:21:29 +00:00
|
|
|
|
2024-03-03 10:55:46 +00:00
|
|
|
public void RestaurantSwitchOnOff()
|
2024-02-11 05:21:29 +00:00
|
|
|
{
|
2024-03-03 10:55:46 +00:00
|
|
|
if (!isSwitchOn)
|
|
|
|
{
|
|
|
|
restaurantSwitch.rotation *= Quaternion.Euler(0, 0, -90);
|
|
|
|
isSwitchOn = true;
|
2024-03-03 14:04:28 +00:00
|
|
|
|
|
|
|
foreach (var light in mainLight)
|
|
|
|
{
|
|
|
|
light.SetActive(true);
|
|
|
|
}
|
2024-03-03 10:55:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
restaurantSwitch.rotation *= Quaternion.Euler(0, 0, 90);
|
|
|
|
isSwitchOn = false;
|
2024-03-03 14:04:28 +00:00
|
|
|
|
|
|
|
foreach (var light in mainLight)
|
|
|
|
{
|
|
|
|
light.SetActive(false);
|
|
|
|
}
|
2024-03-03 10:55:46 +00:00
|
|
|
}
|
2024-02-11 05:21:29 +00:00
|
|
|
}
|
2024-03-03 10:55:46 +00:00
|
|
|
}
|