public sealed class TemporaryEffect : Sandbox.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.
Related Guides
Broader workflow and conceptual references connected to this API.
With the BeamEffect you have basically got a LineRenderer that can be animated. You can have it make multiple beams, fade them out over time, scale over time and scroll and scale the texture over time.
The interface Component.ITemporaryEffect is used on a component that comes to an end.
The "life" properties on the decal component allow you to define how long it should live for. Any lifetime curve properties on the Decal will be played back using this time. You can randomise it to add variety.
Constructors
Showing 1 constructors
public TemporaryEffect()
No results match this filter.
Methods
Showing 2 methods
public static void CreateOrphans(Sandbox.GameObject gameObject, bool disableLooping = True)
Look at the children in this GameObject and orphan any temporary effects
Parameters
disableLooping: Default: True
public virtual void OnParentDestroy()
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:TemporaryEffect |