Просмотр исходного кода

Draw light features only if unit is selected

Daniele Bartolini 9 лет назад
Родитель
Сommit
57bb6f999e
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      samples/core/editors/level_editor/level_editor.lua

+ 6 - 6
samples/core/editors/level_editor/level_editor.lua

@@ -330,13 +330,13 @@ function UnitBox:raycast(pos, dir)
 end
 
 function UnitBox:draw()
-	-- Draw lights
-	local lights = RenderWorld.light_instances(LevelEditor._rw, self._unit_id)
-	if lights ~= nil then
-		RenderWorld.light_debug_draw(LevelEditor._rw, lights, LevelEditor._lines)
-	end
-
 	if self._selected then
+		-- Draw lights
+		local lights = RenderWorld.light_instances(LevelEditor._rw, self._unit_id)
+		if lights ~= nil then
+			RenderWorld.light_debug_draw(LevelEditor._rw, lights, LevelEditor._lines)
+		end
+
 		local mesh_component = RenderWorld.mesh_instances(LevelEditor._rw, self._unit_id)
 		if mesh_component then
 			draw_mesh_obb(LevelEditor._rw, self._unit_id, LevelEditor._lines)