NikosAssets.Instantiation 0.1.0
Loading...
Searching...
No Matches
NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject > Class Template Referenceabstract

An abstract wrapper class handling all the addressable logic. More...

Public Member Functions

override async Task< TObject > CreateInstanceAsync (Transform parent=null, bool worldPositionStays=false)
override async Task< TObject > CreateInstanceAsync (Vector3 position, Quaternion rotation, Transform parent=null)
override async Task< TObject > LoadAssetReferenceAsync ()
 Loads the Object to clone and caches it in the CachedAssetReference
override async Task UnloadAssetReference ()
 Unloads the CachedAssetReference when using addressables. For convenience you can also just call Dispose().
Public Member Functions inherited from NikosAssets.Instantiation.BaseInstantiationMono< TObject >
virtual void Dispose ()
 Executed by OnDestroy
Task< TObject > CreateInstanceAsync (Transform parent=null, bool worldPositionStays=false)
Task< TObject > CreateInstanceAsync (Vector3 position, Quaternion rotation, Transform parent=null)
Task< TObject > LoadAssetReferenceAsync ()
 Loads the Object to clone and caches it in the CachedAssetReference
Task UnloadAssetReference ()
 Unloads the CachedAssetReference when using addressables. For convenience you can also just call Dispose().

Public Attributes

AssetReferenceT< TObject > assetReference
 The assetReference you want to load and cache.

Protected Member Functions

override void OnDestroy ()
 Calls Dispose

Protected Attributes

CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource()

Properties

override TObject CachedAssetReference [get, set]
 Either set a cached asset yourself or call and await LoadAssetReferenceAsync() to initialize this property. By default, this cached asset reference will be used for Instantiation and it is even recommended you use it yourself to avoid overhead.
Properties inherited from NikosAssets.Instantiation.BaseInstantiationMono< TObject >
TObject CachedAssetReference [get, set]
 Either set a cached asset yourself or call and await LoadAssetReferenceAsync() to initialize this property. By default, this cached asset reference will be used for Instantiation and it is even recommended you use it yourself to avoid overhead.

Detailed Description

An abstract wrapper class handling all the addressable logic.

Template Parameters
TObjectTo load and cache
Type Constraints
TObject :Object 

Member Function Documentation

◆ CreateInstanceAsync() [1/2]

override async Task< TObject > NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >.CreateInstanceAsync ( Transform parent = null,
bool worldPositionStays = false )

◆ CreateInstanceAsync() [2/2]

override async Task< TObject > NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >.CreateInstanceAsync ( Vector3 position,
Quaternion rotation,
Transform parent = null )

◆ LoadAssetReferenceAsync()

override async Task< TObject > NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >.LoadAssetReferenceAsync ( )

Loads the Object to clone and caches it in the CachedAssetReference

Returns
The CachedAssetReference

Implements NikosAssets.Instantiation.IInstantiation< TObject >.

◆ OnDestroy()

override void NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >.OnDestroy ( )
protectedvirtual

◆ UnloadAssetReference()

override async Task NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >.UnloadAssetReference ( )

Unloads the CachedAssetReference when using addressables. For convenience you can also just call Dispose().

Returns

Implements NikosAssets.Instantiation.IInstantiation< TObject >.

Property Documentation

◆ CachedAssetReference

override TObject NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >.CachedAssetReference
getset

Either set a cached asset yourself or call and await LoadAssetReferenceAsync() to initialize this property. By default, this cached asset reference will be used for Instantiation and it is even recommended you use it yourself to avoid overhead.

Implements NikosAssets.Instantiation.IInstantiation< TObject >.


The documentation for this class was generated from the following file:
  • BaseAddressableInstantiationMono.cs