You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Draw method, each ISceneObject.Image loads from cache "on the fly".
It works good for UI objects like windows (they may not opened at all) and when count of ISceneObject at scene not much.
But its not working for save/load or loading a lot of information from DB (especially, not images).
Proposal
By steps:
Add ISceneObject.LoadResources() method with return type IEnumerable<string> or something
Add IScene.LoadResources() and call it after SceneManager.ChangeScene
In Scene.LoadResources take all created objects (in init method) and call all tree of LoadResources() in each ISceneObject
Load all resources through ResourceManager, for not breaking current logic of loading resource into current IScene
Important
Current pipeline and logic must be save for UI windows or other things with low resources, and for some logic in ISceneObject constructors where ResourceLoader can load some json data - now it's done "in the background".
The text was updated successfully, but these errors were encountered:
aneteanetes
changed the title
Scene.LoadResources
Strategy of loading resources
May 1, 2023
Info
Need add another loading resources strategy.
Now
In
Draw
method, eachISceneObject.Image
loads from cache "on the fly".It works good for UI objects like windows (they may not opened at all) and when count of
ISceneObject
at scene not much.But its not working for save/load or loading a lot of information from DB (especially, not images).
Proposal
By steps:
ISceneObject.LoadResources()
method with return typeIEnumerable<string>
or somethingIScene.LoadResources()
and call it afterSceneManager.ChangeScene
Scene.LoadResources
take all created objects (in init method) and call all tree ofLoadResources()
in eachISceneObject
ResourceManager
, for not breaking current logic of loading resource into currentIScene
Important
Current pipeline and logic must be save for UI windows or other things with low resources, and for some logic in
ISceneObject
constructors whereResourceLoader
can load some json data - now it's done "in the background".The text was updated successfully, but these errors were encountered: