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

A wrapper class to handle the instantiation implementation as a MonoBehaviour. More...

Public Member Functions

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().

Protected Member Functions

virtual void OnDestroy ()
 Calls Dispose

Properties

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

A wrapper class to handle the instantiation implementation as a MonoBehaviour.

Template Parameters
TObject
Type Constraints
TObject :Object 

Member Function Documentation

◆ CreateInstanceAsync() [1/2]

Task< TObject > NikosAssets.Instantiation.BaseInstantiationMono< TObject >.CreateInstanceAsync ( Transform parent = null,
bool worldPositionStays = false )
abstract

◆ CreateInstanceAsync() [2/2]

Task< TObject > NikosAssets.Instantiation.BaseInstantiationMono< TObject >.CreateInstanceAsync ( Vector3 position,
Quaternion rotation,
Transform parent = null )
abstract

◆ LoadAssetReferenceAsync()

Task< TObject > NikosAssets.Instantiation.BaseInstantiationMono< TObject >.LoadAssetReferenceAsync ( )
abstract

Loads the Object to clone and caches it in the CachedAssetReference

Returns
The CachedAssetReference

Implements NikosAssets.Instantiation.IInstantiation< TObject >.

◆ OnDestroy()

virtual void NikosAssets.Instantiation.BaseInstantiationMono< TObject >.OnDestroy ( )
protectedvirtual

◆ UnloadAssetReference()

Task NikosAssets.Instantiation.BaseInstantiationMono< TObject >.UnloadAssetReference ( )
abstract

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

Returns

Implements NikosAssets.Instantiation.IInstantiation< TObject >.

Property Documentation

◆ CachedAssetReference

TObject NikosAssets.Instantiation.BaseInstantiationMono< TObject >.CachedAssetReference
getsetabstract

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:
  • BaseInstantiationMono.cs