This class is used for resources hot update, you can update images or scripts during runtime of the game. More...
Inherits Ref.
Public Types | |
enum | State { UNCHECKED, PREDOWNLOAD_VERSION, DOWNLOADING_VERSION, VERSION_LOADED, PREDOWNLOAD_MANIFEST, DOWNLOADING_MANIFEST, MANIFEST_LOADED, NEED_UPDATE, UPDATING, UP_TO_DATE, FAIL_TO_UPDATE } |
Update states. More... | |
Public Member Functions | |
void | checkUpdate () |
Check out if there is a new version of manifest. More... | |
void | update () |
Update with the current local manifest. | |
var | update () |
Update with the current local manifest. | |
local | update () |
Update with the current local manifest. | |
void | downloadFailedAssets () |
Reupdate all failed assets under the current AssetsManagerEx context, failed assets are noted in the previous update process. | |
var | downloadFailedAssets () |
Reupdate all failed assets under the current AssetsManagerEx context, failed assets are noted in the previous update process. | |
local | downloadFailedAssets () |
Reupdate all failed assets under the current AssetsManagerEx context, failed assets are noted in the previous update process. | |
State | getState () const |
Gets the current update state. More... | |
const std::string & | getStoragePath () const |
Gets storage path. More... | |
var | getStoragePath () |
Gets storage path. More... | |
local | getStoragePath () |
Gets storage path. More... | |
const Manifest * | getLocalManifest () const |
Function for retrieve the local manifest object. More... | |
const Manifest * | getRemoteManifest () const |
Function for retrieve the remote manifest object The remote manifest. | |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
local | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
local | getReferenceCount () |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Destructor. | |
Static Public Member Functions | |
static AssetsManagerEx * | create (const std::string &manifestUrl, const std::string &storagePath) |
Create function for creating a new AssetsManagerEx, use local manifest path and storage path as parameters. More... | |
local | create ( local manifestUrl, local storagePath) |
Create function for creating a new AssetsManagerEx, use local manifest path and storage path as parameters. More... | |
Additional Inherited Members | |
Public Attributes inherited from Ref | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
local | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
local | _luaID |
Lua reference id. | |
void * | _scriptObject |
scriptObject, support for swift | |
local | _scriptObject |
scriptObject, support for swift | |
bool | _rooted |
When true, it means that the object was already rooted. | |
local | _rooted |
When true, it means that the object was already rooted. | |
bool | _scriptOwned |
The life of the object is scrolled by the scripting engine. More... | |
local | _scriptOwned |
The life of the object is scrolled by the scripting engine. More... | |
This class is used for resources hot update, you can update images or scripts during runtime of the game.
Compare to AssetsManager class, it's a upgraded version. It's based on manifest configuration files to compare between local version and remote version, then generate a list of assets which need to be upgraded, download them then finish the update process. It contains the following features:
|
static |
Create function for creating a new AssetsManagerEx, use local manifest path and storage path as parameters.
The url for the local manifest file The storage path for downloaded assetes The cached manifest in your storage path have higher priority and will be searched first, only if it doesn't exist, AssetsManagerEx will use the given manifestUrl.
|
static |
Create function for creating a new AssetsManagerEx, use local manifest path and storage path as parameters.
The url for the local manifest file The storage path for downloaded assetes The cached manifest in your storage path have higher priority and will be searched first, only if it doesn't exist, AssetsManagerEx will use the given manifestUrl.
|
static |
Create function for creating a new AssetsManagerEx, use local manifest path and storage path as parameters.
The url for the local manifest file The storage path for downloaded assetes The cached manifest in your storage path have higher priority and will be searched first, only if it doesn't exist, AssetsManagerEx will use the given manifestUrl.
void checkUpdate | ( | ) |
Check out if there is a new version of manifest.
You may use this method before updating, then let user determine whether he wants to update resources.
var checkUpdate | ( | ) |
Check out if there is a new version of manifest.
You may use this method before updating, then let user determine whether he wants to update resources.
local checkUpdate | ( | ) |
Check out if there is a new version of manifest.
You may use this method before updating, then let user determine whether he wants to update resources.
State getState | ( | ) | const |
Gets the current update state.
The current update state.
var getState | ( | ) |
Gets the current update state.
The current update state.
local getState | ( | ) |
Gets the current update state.
The current update state.
const std::string& getStoragePath | ( | ) | const |
Gets storage path.
The storage path.
var getStoragePath | ( | ) |
Gets storage path.
The storage path.
local getStoragePath | ( | ) |
Gets storage path.
The storage path.
const Manifest* getLocalManifest | ( | ) | const |
Function for retrieve the local manifest object.
The local manifest.
var getLocalManifest | ( | ) |
Function for retrieve the local manifest object.
The local manifest.
local getLocalManifest | ( | ) |
Function for retrieve the local manifest object.
The local manifest.