68 lines
2.0 KiB
C#
68 lines
2.0 KiB
C#
using AibisDream.Framework;
|
|
using Yarn.Unity;
|
|
using System.Collections;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
public static class FixLightYarnCommand
|
|
{
|
|
private static FixLightSystem LightSystem => FixSystemCenter.SystemDic.Get<FixLightSystem>();
|
|
|
|
[YarnCommand("set_light_state")]
|
|
public static void SetLightState(string state)
|
|
{
|
|
if (System.Enum.TryParse<FixLightSystem.LightState>(state, true, out var lightState))
|
|
{
|
|
LightSystem.SetLightState(lightState);
|
|
}
|
|
}
|
|
|
|
[YarnCommand("set_small_light_state")]
|
|
public static void SetSmallLightState(string state)
|
|
{
|
|
if (System.Enum.TryParse<FixLightSystem.SmallLightState>(state, true, out var smallLightState))
|
|
{
|
|
LightSystem.SetSmallLightState(smallLightState);
|
|
}
|
|
}
|
|
|
|
[YarnCommand("set_small_light_status")]
|
|
public static void SetSmallLightStatus(string status)
|
|
{
|
|
if (System.Enum.TryParse<FixLightSystem.SmallLightStatus>(status, true, out var smallLightStatus))
|
|
{
|
|
LightSystem.SetSmallLightStatus(smallLightStatus);
|
|
}
|
|
}
|
|
|
|
[YarnCommand("set_environment_light_flickering")]
|
|
public static void SetEnvironmentLightFlickering(bool isFlickering)
|
|
{
|
|
LightSystem.SetEnvironmentLightFlickering(isFlickering);
|
|
}
|
|
|
|
[YarnCommand("set_alarm_blink_speed")]
|
|
public static void SetAlarmBlinkSpeed(float speed)
|
|
{
|
|
if (LightSystem != null)
|
|
{
|
|
LightSystem.SetAlarmBlinkSpeed(speed);
|
|
}
|
|
}
|
|
|
|
[YarnCommand("stop_alarm_light")]
|
|
public static void StopAlarmLight()
|
|
{
|
|
if (LightSystem != null)
|
|
{
|
|
LightSystem.StopAlarmLight();
|
|
}
|
|
}
|
|
|
|
[YarnCommand("start_system")]
|
|
public static IEnumerator StartSystem()
|
|
{
|
|
yield return LightSystem.StartSystem();
|
|
}
|
|
}
|
|
} |