Api TemporaryEffect
class

TemporaryEffect

public sealed class TemporaryEffect : Component

Destroys a GameObject after a number of seconds. If the GameObject or its children have any components that implement ITemporaryEffect we will wait for those to be finished before destroying. This is particularly useful if you want to delete a GameObject but want to wait for sounds or particles to conclude.

Constructors

TemporaryEffect()

Methods

virtual Void OnParentDestroy()
static Void CreateOrphans(GameObject gameObject, Boolean disableLooping = True)

Look at the children in this GameObject and orphan any temporary effects

Fields

Name Type Description
DestroyAfterSeconds Single Number of seconds to wait before destroying
WaitForChildEffects Boolean If true we will wait for any ITemporaryEffect's to finish before destroying
BecomeOrphan Boolean If the parent GameObject is destroyed we should become orphaned instead of being destroyed ourselves. Once orphaned we'll stop all looping effects and wait to die.
Assembly: Sandbox.Engine Full Name: TemporaryEffect