Interface IAssetSaver
This interface allows you to explicitly save temporary assets. This can be useful when writing textures, or when you need to save assets (e.g. animator objects) prior to the automatic serialization pass at the end of processing.
The asset saver must be disposed at the end of the avatar build.
public interface IAssetSaver : IDisposable
- Inherited Members
Properties
CurrentContainer
Returns the current unity object which is being used as a container for assets. May return null if asset saving is disabled.
Normally, it's better to use SaveAsset; saving too many assets to the same asset container can be slow. However this property can be used for compatibility with legacy NDMF APIs.
UnityEngine.Object? CurrentContainer { get; }
Property Value
Methods
GetPersistedAssets()
Returns all assets persisted using this IAssetSaver.
IEnumerable<UnityEngine.Object> GetPersistedAssets()
Returns
- IEnumerable<UnityEngine.Object>
an enumerable of assets
IsTemporaryAsset(Object?)
Determines if an asset is temporary and safe to overwrite. Returns true for null.
bool IsTemporaryAsset(UnityEngine.Object? asset)
Parameters
asset
UnityEngine.Object?The asset to check.
Returns
- bool
true if the object is non-persistent, or was saved as part of this avatar's processing
SaveAsset(Object?)
Saves an asset immediately. If the asset is already persistent or is null, this function does nothing.
void SaveAsset(UnityEngine.Object? asset)
Parameters
asset
UnityEngine.Object?The asset to save.
SaveAssets(IEnumerable<Object>)
Saves a list of assets in batch. This can be more efficient than saving assets one by one.
void SaveAssets(IEnumerable<UnityEngine.Object> assets)
Parameters
assets
IEnumerable<UnityEngine.Object>