Merge branch 'bugfix/打孔带重构' into 'develop'
fix: 维修面板初始灯光状态可配置 See merge request aibis-dream/aibis-dream!657
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -123,10 +123,10 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
// 先加载对话气泡,避免 Yarn 对话(如 测试 节点 me: 释放log)在相机切换完成前执行时找不到 Player 槽位
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var data = clinicSystem.bubbleSlotGroup.CollectData();
|
||||
DialogUIManager.Instance.LoadBubbles(data);
|
||||
// 切换相机
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Clinic);
|
||||
var data = clinicSystem.bubbleSlotGroup.CollectData();
|
||||
DialogUIManager.Instance.LoadBubbles(data);
|
||||
}
|
||||
|
||||
public IEnumerator Exit()
|
||||
@@ -159,14 +159,14 @@ namespace AibisDream.FixSystem
|
||||
bodyModuleSystem.SwitchModuleGroup(moduleState);
|
||||
}
|
||||
|
||||
if (cablePanel != null && !cablePanel.IsSystemOn())
|
||||
if (cablePanel != null && !FixPanelSystem.Instance.IsSystemOn)
|
||||
{
|
||||
// 切换相机
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModuleCenter);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.5f);
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
||||
yield return cablePanel.StartSystem();
|
||||
yield return FixPanelSystem.Instance.StartAllSystems();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -76,6 +76,11 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#region 光照系统 - 公共方法
|
||||
|
||||
public void Initialize(bool isSystemOn)
|
||||
{
|
||||
panelLight.intensity = isSystemOn ? panelLightIntensity : 0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置灯光状态
|
||||
/// </summary>
|
||||
@@ -89,6 +94,14 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 压暗光照强度
|
||||
/// </summary>
|
||||
public void DarkenLights()
|
||||
{
|
||||
panelLight.intensity = 0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置环境灯闪烁状态
|
||||
/// </summary>
|
||||
@@ -143,14 +156,6 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动面板灯光序列(纯灯光效果,不包含其他面板的协调)
|
||||
/// </summary>
|
||||
public IEnumerator StartPanelLightSequence()
|
||||
{
|
||||
yield return StartCoroutine(PanelLightStartSequence());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 光照系统 - 状态更新方法
|
||||
@@ -316,7 +321,7 @@ namespace AibisDream.FixSystem
|
||||
/// <summary>
|
||||
/// 面板灯启动序列
|
||||
/// </summary>
|
||||
private IEnumerator PanelLightStartSequence()
|
||||
public IEnumerator PanelLightStartSequence()
|
||||
{
|
||||
if (panelLight == null) yield break;
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace AibisDream.FixSystem
|
||||
private void Start()
|
||||
{
|
||||
InitComponentRefs();
|
||||
panelLight?.Initialize();
|
||||
|
||||
InitSystem();
|
||||
LoadCableState();
|
||||
@@ -64,12 +63,18 @@ namespace AibisDream.FixSystem
|
||||
plugRef.OnPullUpSocket -= OnPullUpSocket;
|
||||
plugRef.OnPlugPointerDown -= OnPlugPoinerDown;
|
||||
}
|
||||
|
||||
|
||||
private void InitComponentRefs()
|
||||
{
|
||||
BodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
}
|
||||
|
||||
|
||||
public void InitLight(bool isLightOn)
|
||||
{
|
||||
panelLight?.Initialize(isLightOn);
|
||||
}
|
||||
|
||||
private void InitSystem()
|
||||
{
|
||||
plugRef.OnInsertSocket += OnInsertSocket;
|
||||
@@ -279,14 +284,6 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#region 灯光系统 - 供外部调用
|
||||
|
||||
/// <summary>
|
||||
/// 检查系统是否开启
|
||||
/// </summary>
|
||||
public bool IsSystemOn()
|
||||
{
|
||||
return panelLight != null && panelLight.IsSystemOn();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动系统
|
||||
/// </summary>
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#region 系统状态字段
|
||||
|
||||
[SerializeField] private bool isSystemOn = false;
|
||||
private bool isSystemStarting = false;
|
||||
private Coroutine smallLightsBlinkCoroutine;
|
||||
private bool isLightOn;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -95,13 +95,14 @@ namespace AibisDream.FixSystem
|
||||
/// <summary>
|
||||
/// 初始化灯光系统
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
public void Initialize(bool isLightOn)
|
||||
{
|
||||
this.isLightOn = isLightOn;
|
||||
// 初始化SpriteRenderer引用
|
||||
InitializeSpriteRenderers();
|
||||
|
||||
// 初始化系统状态
|
||||
if (isSystemOn)
|
||||
if (isLightOn)
|
||||
{
|
||||
InitializeSystemOn();
|
||||
}
|
||||
@@ -160,20 +161,11 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#region 公共方法 - 系统控制
|
||||
|
||||
/// <summary>
|
||||
/// 检查系统是否开启
|
||||
/// </summary>
|
||||
public bool IsSystemOn()
|
||||
{
|
||||
return isSystemOn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统电源状态
|
||||
/// </summary>
|
||||
public void SetSystemPower(bool isOn)
|
||||
{
|
||||
isSystemOn = isOn;
|
||||
if (!isOn)
|
||||
{
|
||||
TurnOffAllLights();
|
||||
@@ -189,10 +181,10 @@ namespace AibisDream.FixSystem
|
||||
/// </summary>
|
||||
public IEnumerator StartSystem()
|
||||
{
|
||||
if (isSystemStarting || isSystemOn) yield break;
|
||||
if (isSystemStarting || isLightOn) yield break;
|
||||
|
||||
isSystemStarting = true;
|
||||
yield return StartCoroutine(SystemStartSequence());
|
||||
yield return SystemStartSequence();
|
||||
isSystemStarting = false;
|
||||
}
|
||||
|
||||
@@ -446,7 +438,7 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (!isSystemOn)
|
||||
if (!isLightOn)
|
||||
{
|
||||
TurnOffAllSmallLights();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user