initial commit
This commit is contained in:
29
Behaviour.cs
Normal file
29
Behaviour.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using MyBox;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AutoLight;
|
||||
public class Behaviour : MonoBehaviour
|
||||
{
|
||||
private LightSwitch[] LightSwitches;
|
||||
private void Start()
|
||||
{
|
||||
LightSwitches = Object.FindObjectsOfType<LightSwitch>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
DayCycleManager __instance = Singleton<DayCycleManager>.Instance;
|
||||
StoreLightManager __storelightmanager = Singleton<StoreLightManager>.Instance;
|
||||
if (__instance.CurrentHour == 6 && __instance.CurrentMinute == 0 && __instance.AM == false)
|
||||
{
|
||||
for (int i = 0; i < LightSwitches.Length; i++)
|
||||
{
|
||||
LightSwitch lightSwitch = LightSwitches[i];
|
||||
if (!__storelightmanager.m_IsOn)
|
||||
{
|
||||
lightSwitch.InstantInteract();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user