Asset manager

Warning

Assets

After creating your assets in Game Studio, @'Xenko.Core.Serialization.Assets.AssetManager' is the class responsible for loading, unloading and saving assets.

You usually create assets directly in Game Studio.

Their URL will match the name (including folder) in Game Studio.

  • knight (user imports knight.fbx directly in main asset folder)
  • level1/room1 (user creates level1 and import room1.fbx inside)For more information, see Assets for more details.

Loading an asset should be done with the help of @'Xenko.Core.Serialization.Assets.AssetManager' class:

Note that loading an asset that has already been loaded only increment the reference counter and do not reload the asset.

Unloading is also done using the AssetManager class:

An asset is actually loaded only during the first call to 'load'. All subsequent calls only result to an asset reference increment.

An asset is actually unload only when the number of call to unload match the number of call the load.

The @'Xenko.Core.Serialization.Assets.AssetManager.Get' method returns the reference to a loaded asset but does not increment the asset reference counter.