fix: 维修面板初始灯光状态可配置
This commit is contained in:
@@ -13,6 +13,11 @@ namespace AibisDream.FixSystem
|
||||
/// </summary>
|
||||
public class FixPanelSystem : Singleton<FixPanelSystem>
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
InitLight();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
RegisterCanvasCamera();
|
||||
@@ -50,6 +55,9 @@ namespace AibisDream.FixSystem
|
||||
#region 维修管理扩展
|
||||
|
||||
[Header("光照系统")]
|
||||
[SerializeField] private bool isSystemOn = false;
|
||||
public bool IsSystemOn => isSystemOn;
|
||||
|
||||
[SerializeField] private FixPanelLight panelLight;
|
||||
public FixPanelLight PanelLight => panelLight;
|
||||
|
||||
@@ -57,6 +65,17 @@ namespace AibisDream.FixSystem
|
||||
[SerializeField] private RepairSystemManager repairSystemManager;
|
||||
public RepairSystemManager RepairSystemManager => repairSystemManager;
|
||||
|
||||
private void InitLight()
|
||||
{
|
||||
panelLight.Initialize(isSystemOn);
|
||||
GetRepairPanel<CablePanel>().InitLight(isSystemOn);
|
||||
// 无光环境下屏幕也不能亮
|
||||
if (!isSystemOn)
|
||||
{
|
||||
screenPanel.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 系统启动协调
|
||||
@@ -76,8 +95,11 @@ namespace AibisDream.FixSystem
|
||||
// 2. 再启动灯光序列
|
||||
if (panelLight != null)
|
||||
{
|
||||
yield return panelLight.StartPanelLightSequence();
|
||||
yield return panelLight.PanelLightStartSequence();
|
||||
}
|
||||
|
||||
// 3. 再启动屏幕面板
|
||||
screenPanel.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user