feat(fix-system): 添加维修模块运行状态表现
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user