LoadAsset
Methods
public void LoadAsset(string networkAssetId, Action<ICoherenceSync> onLoaded)
Called when coherence needs to load a prefab to memory, to instantiate it when a new network entity is created.
Parameters
Type | Name | Description |
---|---|---|
string | networkAssetId | |
Action<ICoherenceSync> | onLoaded |
public ICoherenceSync LoadAsset(string networkAssetId)
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.
Parameters
Type | Name | Description |
---|---|---|
string | networkAssetId |
Returns
Type | Description |
---|---|
ICoherenceSync |