NikosAssets.Instantiation 0.1.0
Loading...
Searching...
No Matches
NikosAssets.Instantiation.IInstantiation< TObject > Interface Template Reference

Defines a contract for instantiating Unity Objects in an async manner. More...

Public Member Functions

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

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

Defines a contract for instantiating Unity Objects in an async manner.

Template Parameters
TObjectThe type of the Unity object managed by this interface, constrained to UnityEngine.Object types.
Type Constraints
TObject :Object 

Member Function Documentation

◆ CreateInstanceAsync() [1/2]

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

◆ CreateInstanceAsync() [2/2]

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

◆ LoadAssetReferenceAsync()

◆ UnloadAssetReference()

Task NikosAssets.Instantiation.IInstantiation< TObject >.UnloadAssetReference ( )

Property Documentation

◆ CachedAssetReference

TObject NikosAssets.Instantiation.IInstantiation< 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.

Implemented in NikosAssets.Instantiation.BaseAddressableInstantiationMono< TObject >, NikosAssets.Instantiation.BaseDefaultInstantiationMono< TObject >, NikosAssets.Instantiation.BaseInstantiationData< TObject >, and NikosAssets.Instantiation.BaseInstantiationMono< TObject >.


The documentation for this interface was generated from the following file:
  • IInstantiation.cs