跳至內容

SpringRTS/Callins 中的 Lua/UnitDestroyed()

來自華夏公益教科書

UnitDestroyed()

[編輯 | 編輯原始碼]

當單位被摧毀時執行。這可能意味著該單位被敵人殺死或自我毀滅。
在非同步模式下,當您的單位被摧毀時,會呼叫該函式。在同步模式下,它會對遊戲中的任何單位進行呼叫。

返回值

[編輯 | 編輯原始碼]

整數 unitID,
整數 unitDefID,
整數 unitTeam

使用示例

[編輯 | 編輯原始碼]
function widget:UnitDestroyed(unitID, unitDefID, unitTeamID, attackerID)
  Spring.Echo("Unit "..unitID.." from team "..unitTeamID.." just got destroyed by enemy unit "..attackerID)
end


UnitCreated()

華夏公益教科書