TilePlus Version 5
Unity3D Tilemap Extension
Loading...
Searching...
No Matches
TilePlus.TpSpawnLink Class Reference

simple class that exists to provide context for a spawned prefab. Includes init after spawn, despawning, optional auto-destroy feature, etc., and an optional Note/Tag field. More...

Inheritance diagram for TilePlus.TpSpawnLink:
Collaboration diagram for TilePlus.TpSpawnLink:

Public Member Functions

int string[] tags GetTags (bool toLower=true)
virtual void OnTpSpawned ()
 This is called when the prefab is instantiated or fetched from pool. BE SURE TO CALL THIS BASE CLASS WHEN OVERRIDING.
virtual void SetAutoDestroyManually (float duration)
 Change the Auto-destroy timeout.
virtual void OnTpDespawned ()
 This is called when the prefab is returned to the pool. BE SURE TO CALL THIS BASE CLASS WHEN OVERRIDING.
virtual void DespawnMe ()
 Use this to despawn your prefab. Normally you don't need to override this. BE SURE TO CALL THIS BASE CLASS WHEN OVERRIDING.

Public Attributes

bool m_AutoDestroy
 Controls auto-destroy use.
bool m_IgnoreCollider = false
 Ignore the collider when spawning. When this is FALSE then if the prefab has ANY colliders then it's added to a HashSet in TpSpawner. Set this variable TRUE to inhibit that.
string m_NoteOrTag
 A note or a comma-separated set of tags. Use GetTags property to get an array of trimmed tags and a count of same.
float m_AutoDestroyTimeout = 5f
 Set the auto-destroy timeout.
bool m_IgnoreTimeout
 If true, ignore the auto-destroy when Timeout is called.
int m_SourcePrefabId
 instance ID of source (ie project folder) prefab that this was spawned from
int count
 Property to get a tuple of (count, array of individually-trimmed tags). not cached.

Detailed Description

simple class that exists to provide context for a spawned prefab. Includes init after spawn, despawning, optional auto-destroy feature, etc., and an optional Note/Tag field.

Member Function Documentation

◆ DespawnMe()

virtual void TilePlus.TpSpawnLink.DespawnMe ( )
virtual

Use this to despawn your prefab. Normally you don't need to override this. BE SURE TO CALL THIS BASE CLASS WHEN OVERRIDING.

◆ GetTags()

int string[] tags TilePlus.TpSpawnLink.GetTags ( bool toLower = true)

◆ OnTpDespawned()

virtual void TilePlus.TpSpawnLink.OnTpDespawned ( )
virtual

This is called when the prefab is returned to the pool. BE SURE TO CALL THIS BASE CLASS WHEN OVERRIDING.

◆ OnTpSpawned()

virtual void TilePlus.TpSpawnLink.OnTpSpawned ( )
virtual

This is called when the prefab is instantiated or fetched from pool. BE SURE TO CALL THIS BASE CLASS WHEN OVERRIDING.

◆ SetAutoDestroyManually()

virtual void TilePlus.TpSpawnLink.SetAutoDestroyManually ( float duration)
virtual

Change the Auto-destroy timeout.

Parameters
durationtime until auto-destroy and return to pool.

sets m_IgnoreTimeout to false and m_AutoDestroy to true.

Member Data Documentation

◆ count

int TilePlus.TpSpawnLink.count

Property to get a tuple of (count, array of individually-trimmed tags). not cached.

Parameters
toLowerdoes a ToLowerInvariant on each tag.

returns (count, string[] tags). tags array is null (and count is 0) if there are no tags, OR an empty list if all trimmed tags eval to empty>

◆ m_AutoDestroy

bool TilePlus.TpSpawnLink.m_AutoDestroy

Controls auto-destroy use.

◆ m_AutoDestroyTimeout

float TilePlus.TpSpawnLink.m_AutoDestroyTimeout = 5f

Set the auto-destroy timeout.

◆ m_IgnoreCollider

bool TilePlus.TpSpawnLink.m_IgnoreCollider = false

Ignore the collider when spawning. When this is FALSE then if the prefab has ANY colliders then it's added to a HashSet in TpSpawner. Set this variable TRUE to inhibit that.

◆ m_IgnoreTimeout

bool TilePlus.TpSpawnLink.m_IgnoreTimeout

If true, ignore the auto-destroy when Timeout is called.

◆ m_NoteOrTag

string TilePlus.TpSpawnLink.m_NoteOrTag

A note or a comma-separated set of tags. Use GetTags property to get an array of trimmed tags and a count of same.

◆ m_SourcePrefabId

int TilePlus.TpSpawnLink.m_SourcePrefabId

instance ID of source (ie project folder) prefab that this was spawned from


The documentation for this class was generated from the following file:
  • /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/MonoComponents/TpSpawnLink.cs