modules/world: only attach view to camera if one is requested
This commit is contained in:
parent
9c3ef4ce65
commit
79ecdc822b
1 changed files with 8 additions and 4 deletions
|
@ -83,15 +83,19 @@ function CameraSystem:getViewCam(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
function CameraSystem:attachView(id)
|
function CameraSystem:attachView(id)
|
||||||
|
if (id ~= nil) then
|
||||||
local cam = self:getViewCam(id)
|
local cam = self:getViewCam(id)
|
||||||
|
|
||||||
cam:attach()
|
cam:attach()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function CameraSystem:detachView(id)
|
function CameraSystem:detachView(id)
|
||||||
|
if (id ~= nil) then
|
||||||
local cam = self:getViewCam(id)
|
local cam = self:getViewCam(id)
|
||||||
|
|
||||||
cam:detach()
|
cam:detach()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return CameraSystem
|
return CameraSystem
|
||||||
|
|
Loading…
Reference in a new issue