Infohazard.Core 1.4.1
Infohazard Core Utility Library
Loading...
Searching...
No Matches
Infohazard.Core.SpawnRefBase< T > Class Template Referenceabstract

Only used internally. More...

Classes

class  PropNames
 This is used to refer to the names of private fields in this class from a custom Editor. More...
 

Public Member Functions

 SpawnRefBase ()
 Default constructor (needed for Unity serialization). More...
 
 SpawnRefBase (T prefab)
 Construct with a given prefab. More...
 
virtual void Retain ()
 Add a user to the SpawnRef, creating the DefaultPoolHandler if necessary. More...
 
virtual void Release ()
 Remove a user from the SpawnRef, in turn releasing the IPoolHandler. More...
 
Spawn (in SpawnParams spawnParams=default)
 Spawn an instance of Prefab. The SpawnRef MUST be retained. More...
 

Protected Member Functions

abstract void GetSpawnableAndGameObject (T obj, out Spawnable spawnable, out GameObject gameObject)
 Override to return the associated Spawnable script and GameObject for given object. More...
 

Properties

bool IsValid [get]
 Whether there is a valid prefab is attached. More...
 
Prefab [get]
 The prefab to be spawned. More...
 

Detailed Description

Only used internally.

Used as a serializable utility for referencing a prefab, managing its DefaultPoolHandler, and retaining/releasing that pool handler as necessary.

Template Parameters
TThe type of object to be referenced.
Type Constraints
T :Object 

Constructor & Destructor Documentation

◆ SpawnRefBase() [1/2]

Default constructor (needed for Unity serialization).

◆ SpawnRefBase() [2/2]

Construct with a given prefab.

Parameters
prefabThe prefab to be spawned.

Member Function Documentation

◆ GetSpawnableAndGameObject()

abstract void Infohazard.Core.SpawnRefBase< T >.GetSpawnableAndGameObject ( obj,
out Spawnable  spawnable,
out GameObject  gameObject 
)
protectedpure virtual

Override to return the associated Spawnable script and GameObject for given object.

Parameters
objThe attached object.
spawnableThe Spawnable script for obj.
gameObjectThe GameObject for obj.

Implemented in Infohazard.Core.SpawnRef< T >.

◆ Release()

virtual void Infohazard.Core.SpawnRefBase< T >.Release ( )
virtual

Remove a user from the SpawnRef, in turn releasing the IPoolHandler.

◆ Retain()

virtual void Infohazard.Core.SpawnRefBase< T >.Retain ( )
virtual

Add a user to the SpawnRef, creating the DefaultPoolHandler if necessary.

The IPoolHandler for the object will be retained.

◆ Spawn()

T Infohazard.Core.SpawnRefBase< T >.Spawn ( in SpawnParams  spawnParams = default)

Spawn an instance of Prefab. The SpawnRef MUST be retained.

Parameters
spawnParamsAdditional spawn info.
Returns
The spawned object.

Property Documentation

◆ IsValid

bool Infohazard.Core.SpawnRefBase< T >.IsValid
get

Whether there is a valid prefab is attached.

◆ Prefab

T Infohazard.Core.SpawnRefBase< T >.Prefab
get

The prefab to be spawned.


The documentation for this class was generated from the following file: