Added assets manager singleton.
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
local make_class = require 'src.utils.classes'
|
||||
local assets = require 'src.utils.asstmngr'
|
||||
local Drawable = require 'src.graphics.drawable'
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Class definitions
|
||||
------------------------------------------------------------------------------
|
||||
@@ -18,8 +20,8 @@ local GameState = make_class(Drawable)
|
||||
|
||||
function GameState:_init(name, index)
|
||||
Drawable._init(self)
|
||||
self.name = name
|
||||
self.index = index
|
||||
self.name = name
|
||||
self.index = index
|
||||
end
|
||||
|
||||
|
||||
@@ -28,6 +30,15 @@ function GameState:update(_)
|
||||
end
|
||||
|
||||
|
||||
function GameState:load()
|
||||
end
|
||||
|
||||
|
||||
function GameState:unload()
|
||||
assets:unload(self.name)
|
||||
end
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Module return
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user