common.lua 559 B

12345678910111213141516171819202122232425
  1. -- Copyright (c) 2012-2025 Daniele Bartolini et al.
  2. -- SPDX-License-Identifier: MIT
  3. local Behavior = Behavior or {}
  4. function Behavior.spawned(world, units)
  5. for uu = 1, #units do
  6. local unit = units[uu]
  7. -- Hide the mesh.
  8. local render_world = World.render_world(world)
  9. local camera_mesh = RenderWorld.mesh_instance(render_world, unit)
  10. if camera_mesh ~= nil then
  11. RenderWorld.mesh_set_visible(render_world, camera_mesh, false)
  12. end
  13. end
  14. end
  15. function Behavior.update(world, dt)
  16. end
  17. function Behavior.unspawned(world, units)
  18. end
  19. return Behavior