fix(bodymodule): 切割时按舱外状态同步CutText
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -99,7 +99,7 @@ namespace AibisDream
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator StartCutting(BodyModule targetModule, bool flickerCutTextOnEnter = false)
|
||||
public IEnumerator StartCutting(BodyModule targetModule)
|
||||
{
|
||||
// 检查参数
|
||||
if (targetModule == null)
|
||||
@@ -122,12 +122,8 @@ namespace AibisDream
|
||||
// 停止之前的切割
|
||||
StopCutting();
|
||||
|
||||
// StopCutting 会将 Cut Text 恢复为可见,因此需要在调用后同步进入状态。
|
||||
_targetModule.SetCutTextVisible(flickerCutTextOnEnter);
|
||||
if (flickerCutTextOnEnter)
|
||||
{
|
||||
_targetModule.StartCutTextFlicker();
|
||||
}
|
||||
// StopCutting 会打断 CutText 闪烁;按舱外 ModuleCondition 重新同步亮灭。
|
||||
_targetModule.ApplyCutTextFromCondition();
|
||||
|
||||
// 设置切割模式
|
||||
isCuttingMode = true;
|
||||
|
||||
@@ -239,6 +239,29 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按当前 ModuleCondition 同步 CutText 亮灭,与舱外 ModuleText 表现一致。
|
||||
/// Normal 常亮 / Damaged 闪烁 / PoweredOff 熄灭。
|
||||
/// </summary>
|
||||
public void ApplyCutTextFromCondition()
|
||||
{
|
||||
StopCutTextFlicker(restoreVisible: false);
|
||||
|
||||
switch (condition)
|
||||
{
|
||||
case ModuleCondition.Normal:
|
||||
SetCutTextVisible(true);
|
||||
break;
|
||||
case ModuleCondition.Damaged:
|
||||
SetCutTextVisible(true);
|
||||
StartCutTextFlicker();
|
||||
break;
|
||||
case ModuleCondition.PoweredOff:
|
||||
SetCutTextVisible(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public SpriteRenderer GetCutSpriteRenderer()
|
||||
{
|
||||
return _cutSpriteRenderer;
|
||||
@@ -263,7 +286,7 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
public void StopCutTextFlicker()
|
||||
public void StopCutTextFlicker(bool restoreVisible = true)
|
||||
{
|
||||
isCutTextFlickering = false;
|
||||
if (flickerCoroutine != null)
|
||||
@@ -272,8 +295,8 @@ namespace AibisDream.FixSystem
|
||||
flickerCoroutine = null;
|
||||
}
|
||||
|
||||
// 确保最终状态是可见的
|
||||
SetCutTextVisible(true);
|
||||
if (restoreVisible)
|
||||
SetCutTextVisible(true);
|
||||
}
|
||||
|
||||
private IEnumerator CutTextFlickerCoroutine()
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace AibisDream.FixSystem
|
||||
bodyModule.GetCutSpriteRenderer().color = new Color(1f, 1f, 1f, 1f);
|
||||
bodyModule.GetCutSpriteRenderer().GetComponentInChildren<SpriteRenderer>().color =
|
||||
new Color(1f, 1f, 1f, 1f);
|
||||
// 相机切入前先对齐 CutText,避免过渡期间亮灭与舱外不一致
|
||||
bodyModule.ApplyCutTextFromCondition();
|
||||
}
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutEmo);
|
||||
@@ -77,13 +79,15 @@ namespace AibisDream.FixSystem
|
||||
bodyModule.GetCutSpriteRenderer().color = new Color(1f, 1f, 1f, 1f);
|
||||
bodyModule.GetCutSpriteRenderer().GetComponentInChildren<SpriteRenderer>().color =
|
||||
new Color(1f, 1f, 1f, 1f);
|
||||
// 相机切入前先对齐 CutText,避免过渡期间亮灭与舱外不一致
|
||||
bodyModule.ApplyCutTextFromCondition();
|
||||
}
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutMemory);
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(0.1f);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutMemoryDeep);
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(0.1f);
|
||||
yield return cuttingManager.StartCutting(bodyModule, flickerCutTextOnEnter: true);
|
||||
yield return cuttingManager.StartCutting(bodyModule);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +125,8 @@ namespace AibisDream.FixSystem
|
||||
bodyModule.GetCutSpriteRenderer().color = new Color(1f, 1f, 1f, 1f);
|
||||
bodyModule.GetCutSpriteRenderer().GetComponentInChildren<SpriteRenderer>().color =
|
||||
new Color(1f, 1f, 1f, 1f);
|
||||
// 相机切入前先对齐 CutText,避免过渡期间亮灭与舱外不一致
|
||||
bodyModule.ApplyCutTextFromCondition();
|
||||
}
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutLogic);
|
||||
|
||||
Reference in New Issue
Block a user