fix(bodymodule): 切割时按舱外状态同步CutText
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user