![]() |
NikosAssets.Instantiation 0.1.0
|
An abstract wrapper class handling the classic instantiation logic. More...
Public Member Functions | |
| override async Task< TObject > | CreateInstanceAsync (Transform parent=null, bool worldPositionStays=false) |
| Just executes the default Instantiate method and returns the result. | |
| override async Task< TObject > | CreateInstanceAsync (Vector3 position, Quaternion rotation, Transform parent=null) |
| Just executes the default Instantiate method and returns the result. | |
| override async Task< TObject > | LoadAssetReferenceAsync () |
| Just returns the CachedAssetReference | |
| override async Task | UnloadAssetReference () |
| For default instantiation, does nothing, as we don't unload prefabs/ original Objects. | |
| 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 | |
| TObject | objToInstantiate |
Properties | |
| override TObject | CachedAssetReference [get, set] |
| Just sets and returns the objToInstantiate | |
| 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. | |
Additional Inherited Members | |
| Protected Member Functions inherited from NikosAssets.Instantiation.BaseInstantiationMono< TObject > | |
| virtual void | OnDestroy () |
| Calls Dispose | |
An abstract wrapper class handling the classic instantiation logic.
| TObject | To load and cache |
| TObject | : | Object |
| override async Task< TObject > NikosAssets.Instantiation.BaseDefaultInstantiationMono< TObject >.CreateInstanceAsync | ( | Transform | parent = null, |
| bool | worldPositionStays = false ) |
Just executes the default Instantiate method and returns the result.
| parent | |
| worldPositionStays |
Implements NikosAssets.Instantiation.IInstantiation< TObject >.
| override async Task< TObject > NikosAssets.Instantiation.BaseDefaultInstantiationMono< TObject >.CreateInstanceAsync | ( | Vector3 | position, |
| Quaternion | rotation, | ||
| Transform | parent = null ) |
Just executes the default Instantiate method and returns the result.
| position | |
| rotation | |
| parent |
Implements NikosAssets.Instantiation.IInstantiation< TObject >.
| override async Task< TObject > NikosAssets.Instantiation.BaseDefaultInstantiationMono< TObject >.LoadAssetReferenceAsync | ( | ) |
Just returns the CachedAssetReference
Implements NikosAssets.Instantiation.IInstantiation< TObject >.
| override async Task NikosAssets.Instantiation.BaseDefaultInstantiationMono< TObject >.UnloadAssetReference | ( | ) |
For default instantiation, does nothing, as we don't unload prefabs/ original Objects.
Implements NikosAssets.Instantiation.IInstantiation< TObject >.
|
getset |
Just sets and returns the objToInstantiate
Implements NikosAssets.Instantiation.IInstantiation< TObject >.