feat(fix-system): 添加维修模块运行状态表现

This commit is contained in:
2026-07-15 19:34:50 +08:00
parent 161fe6ac7d
commit d075d1e0f8
10 changed files with 9414 additions and 3 deletions
@@ -131,6 +131,25 @@ namespace AibisDream
targetModule.Alarm(enable);
}
[YarnCommand("SetModuleState")]
public static void SetModuleState(string moduleName, string stateName)
{
if (!System.Enum.TryParse(stateName, true, out ModuleCondition condition))
{
Debug.LogWarning($"[Yarn] Unknown module state '{stateName}'. Expected Normal, Damaged, or PoweredOff.");
return;
}
var targetModule = BodyModuleSystem?.FindAnyBodyModuleByName(moduleName);
if (targetModule == null)
{
Debug.LogWarning($"[Yarn] Module '{moduleName}' not found.");
return;
}
targetModule.SetCondition(condition);
}
[YarnCommand("DropCable")]
public static void DropCable()
{
@@ -173,4 +192,4 @@ namespace AibisDream
BodyModuleSystem.StopContinuousPain();
}
}
}
}