pawn的全局生产

This commit is contained in:
2025-11-05 11:54:50 +08:00
parent 52951c1a00
commit 19f803bd7d
13 changed files with 239 additions and 401 deletions

View File

@@ -101,12 +101,20 @@ namespace WulaFallenEmpire
return;
foreach (var product in recipe.products)
{
globalStorage.AddToOutputStorage(product.thingDef, product.count);
// 检查产物是否为Pawn
if (product.thingDef.race != null)
{
// 对于Pawn我们存储的是Pawn的ThingDef在释放时再随机生成PawnKind
globalStorage.AddToOutputStorage(product.thingDef, product.count);
}
else
{
// 对于普通物品,正常存储
globalStorage.AddToOutputStorage(product.thingDef, product.count);
}
}
currentCount++;
progress = 0f; // 生产完成后重置进度
if (currentCount >= targetCount)
{
state = ProductionState.Completed;