fix(fix-system): 修复CablePanelLight枚举引用和命名空间问题
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -23,23 +23,6 @@ namespace AibisDream.FixSystem
|
||||
Emergency // 紧急状态
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小灯状态
|
||||
/// </summary>
|
||||
public enum SmallLightState
|
||||
{
|
||||
Default, // 默认状态
|
||||
Operation // 运行状态
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小灯状态状态
|
||||
/// </summary>
|
||||
public enum SmallLightStatus
|
||||
{
|
||||
Normal, // 正常
|
||||
Error // 错误
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using DG.Tweening;
|
||||
using AibisDream.Kit;
|
||||
using AibisDream.Framework;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -51,8 +49,8 @@ namespace AibisDream.FixSystem
|
||||
[SerializeField] private float operationBlinkInterval = 0.1f;
|
||||
|
||||
private List<SpriteRenderer> smallLightSprites = new List<SpriteRenderer>();
|
||||
private FixLightSystem.SmallLightState smallLightState = FixLightSystem.SmallLightState.Default;
|
||||
private FixLightSystem.SmallLightStatus smallLightStatus = FixLightSystem.SmallLightStatus.Normal;
|
||||
private SmallLightState smallLightState = SmallLightState.Default;
|
||||
private SmallLightStatus smallLightStatus = SmallLightStatus.Normal;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -112,7 +110,7 @@ namespace AibisDream.FixSystem
|
||||
InitializeSystemOff();
|
||||
}
|
||||
|
||||
SetSmallLightState(FixLightSystem.SmallLightState.Default);
|
||||
SetSmallLightState(SmallLightState.Default);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -232,14 +230,14 @@ namespace AibisDream.FixSystem
|
||||
/// <summary>
|
||||
/// 设置小灯状态
|
||||
/// </summary>
|
||||
public void SetSmallLightState(FixLightSystem.SmallLightState newState)
|
||||
public void SetSmallLightState(SmallLightState newState)
|
||||
{
|
||||
if (smallLightState != newState)
|
||||
{
|
||||
smallLightState = newState;
|
||||
if (newState == FixLightSystem.SmallLightState.Default)
|
||||
if (newState == SmallLightState.Default)
|
||||
{
|
||||
smallLightStatus = FixLightSystem.SmallLightStatus.Normal;
|
||||
smallLightStatus = SmallLightStatus.Normal;
|
||||
}
|
||||
StartCoroutine(HandleSmallLightStateChange());
|
||||
}
|
||||
@@ -248,7 +246,7 @@ namespace AibisDream.FixSystem
|
||||
/// <summary>
|
||||
/// 设置小灯状态状态
|
||||
/// </summary>
|
||||
public void SetSmallLightStatus(FixLightSystem.SmallLightStatus newStatus)
|
||||
public void SetSmallLightStatus(SmallLightStatus newStatus)
|
||||
{
|
||||
if (smallLightStatus != newStatus)
|
||||
{
|
||||
@@ -364,7 +362,7 @@ namespace AibisDream.FixSystem
|
||||
/// </summary>
|
||||
private IEnumerator HandleSmallLightStateChange()
|
||||
{
|
||||
if (smallLightState == FixLightSystem.SmallLightState.Operation)
|
||||
if (smallLightState == SmallLightState.Operation)
|
||||
{
|
||||
yield return StartCoroutine(OperationBlinkSequence());
|
||||
SetSmallLightsToOperationState();
|
||||
@@ -408,7 +406,7 @@ namespace AibisDream.FixSystem
|
||||
/// </summary>
|
||||
private Color GetSmallLightColorByStatus()
|
||||
{
|
||||
return smallLightStatus == FixLightSystem.SmallLightStatus.Normal ? smallLightNormalColor : smallLightErrorColor;
|
||||
return smallLightStatus == SmallLightStatus.Normal ? smallLightNormalColor : smallLightErrorColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -434,7 +432,7 @@ namespace AibisDream.FixSystem
|
||||
/// </summary>
|
||||
private void UpdateSmallLightsStatus()
|
||||
{
|
||||
Color targetColor = smallLightStatus == FixLightSystem.SmallLightStatus.Normal
|
||||
Color targetColor = smallLightStatus == SmallLightStatus.Normal
|
||||
? smallLightNormalColor
|
||||
: smallLightErrorColor;
|
||||
|
||||
@@ -452,7 +450,7 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
TurnOffAllSmallLights();
|
||||
}
|
||||
else if (smallLightState == FixLightSystem.SmallLightState.Default)
|
||||
else if (smallLightState == SmallLightState.Default)
|
||||
{
|
||||
ResetSmallLightsToDefault();
|
||||
}
|
||||
@@ -595,4 +593,23 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小灯状态
|
||||
/// </summary>
|
||||
public enum SmallLightState
|
||||
{
|
||||
Default, // 默认状态
|
||||
Operation // 运行状态
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小灯状态状态
|
||||
/// </summary>
|
||||
public enum SmallLightStatus
|
||||
{
|
||||
Normal, // 正常
|
||||
Error // 错误
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace AibisDream
|
||||
public static void SetSmallLightState(string state)
|
||||
{
|
||||
if (CablePanelLight == null) return;
|
||||
if (System.Enum.TryParse<FixLightSystem.SmallLightState>(state, true, out var smallLightState))
|
||||
if (System.Enum.TryParse<SmallLightState>(state, true, out var smallLightState))
|
||||
{
|
||||
CablePanelLight.SetSmallLightState(smallLightState);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ namespace AibisDream
|
||||
public static void SetSmallLightStatus(string status)
|
||||
{
|
||||
if (CablePanelLight == null) return;
|
||||
if (System.Enum.TryParse<FixLightSystem.SmallLightStatus>(status, true, out var smallLightStatus))
|
||||
if (System.Enum.TryParse<SmallLightStatus>(status, true, out var smallLightStatus))
|
||||
{
|
||||
CablePanelLight.SetSmallLightStatus(smallLightStatus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user