Class AssetDatabaseProvider
[ExcludeFromDropdown]
public sealed class AssetDatabaseProvider : INetworkObjectProvider
- Inheritance
-
AssetDatabaseProvider
- Implements
Constructors
AssetDatabaseProvider()
public AssetDatabaseProvider()
Methods
Initialize(CoherenceSyncConfig)
Editor only method, that is called when an instance of this provider is assigned to a network entry. If Validate returns false, the UI will show a button that will call Initialize again.
public void Initialize(CoherenceSyncConfig entry)
Parameters
entry
CoherenceSyncConfig
LoadAsset(string)
Called from CoherenceSyncConfig when CoherenceSyncConfig.Instantiate is called, the object is loaded forcing synchronicity. If the provider is naturally asynchronous (Addressables/Asset Bundles), using this method can incur in heavy performance penalties because the main thread will be blocked while the object is loaded.
public ICoherenceSync LoadAsset(string networkAssetId)
Parameters
networkAssetId
string
Returns
LoadAsset(string, Action<ICoherenceSync>)
Called when coherence needs to load a prefab to memory, to instantiate it when a new network entity is created.
public void LoadAsset(string networkAssetId, Action<ICoherenceSync> onLoaded)
Parameters
networkAssetId
stringonLoaded
Action<ICoherenceSync>
OnApplicationQuit()
Called when the application exits.
public void OnApplicationQuit()
Release(ICoherenceSync)
Called when coherence needs to destroy a prefab instance, when the related network entity is destroyed.
public void Release(ICoherenceSync obj)
Parameters
obj
ICoherenceSync
Validate(CoherenceSyncConfig)
Editor only method, that is called by the UI to validate the serialized data of this Provider.
public bool Validate(CoherenceSyncConfig entry)
Parameters
entry
CoherenceSyncConfig