115 lines
3.3 KiB
C#
115 lines
3.3 KiB
C#
using AibisDream.FixSystem;
|
|
using UnityEngine;
|
|
using Yarn.Unity;
|
|
using System.Collections;
|
|
|
|
namespace AibisDream
|
|
{
|
|
public static class ScreenYarnCommand
|
|
{
|
|
private static ScreenSystem ScreenSystem => FixSystemCenter.SystemDic.Get<ScreenSystem>();
|
|
private static FixLightSystem LightSystem => ScreenSystem?.FixLightSystem;
|
|
|
|
#region Screen相关命令
|
|
|
|
[YarnCommand("clear_screen")]
|
|
public static void ClearTextScreen()
|
|
{
|
|
ScreenSystem.ClearTextScreen();
|
|
}
|
|
|
|
[YarnCommand("complete_task")]
|
|
public static void CompleteTask(string lineId)
|
|
{
|
|
ScreenSystem.TaskScreen.CompleteTask(lineId);
|
|
}
|
|
|
|
[YarnCommand("clear_tasks")]
|
|
public static void ClearTasks()
|
|
{
|
|
ScreenSystem.TaskScreen.ClearTasks();
|
|
}
|
|
|
|
[YarnCommand("task_moveIn")]
|
|
public static void ShowTask()
|
|
{
|
|
Debug.LogWarning("task_moveIn 已废弃,请尽快删除");
|
|
}
|
|
|
|
[YarnCommand("task_moveOut")]
|
|
public static void HideTask()
|
|
{
|
|
Debug.LogWarning("task_moveOut 已废弃,请尽快删除");
|
|
}
|
|
|
|
[YarnCommand("show_task_panel")]
|
|
public static void ShowTaskPanel()
|
|
{
|
|
ScreenSystem.ShowTaskPanel();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region FixLightSystem相关命令
|
|
|
|
[YarnCommand("set_light_state")]
|
|
public static void SetLightState(string state)
|
|
{
|
|
if (LightSystem == null) return;
|
|
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 (LightSystem == null) return;
|
|
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 (LightSystem == null) return;
|
|
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)
|
|
{
|
|
if (LightSystem == null) return;
|
|
LightSystem.SetEnvironmentLightFlickering(isFlickering);
|
|
}
|
|
|
|
[YarnCommand("set_alarm_blink_speed")]
|
|
public static void SetAlarmBlinkSpeed(float speed)
|
|
{
|
|
if (LightSystem == null) return;
|
|
LightSystem.SetAlarmBlinkSpeed(speed);
|
|
}
|
|
|
|
[YarnCommand("stop_alarm_light")]
|
|
public static void StopAlarmLight()
|
|
{
|
|
if (LightSystem == null) return;
|
|
LightSystem.StopAlarmLight();
|
|
}
|
|
|
|
[YarnCommand("start_system")]
|
|
public static IEnumerator StartSystem()
|
|
{
|
|
if (LightSystem == null) yield break;
|
|
yield return LightSystem.StartSystem();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |