ITemporaryEffect
The interface Component.ITemporaryEffect is used on a component that comes to an end.
The interface Component.ITemporaryEffect is used on a component that comes to an end.
public interface ITemporaryEffect
{
bool IsActive { get; }
}
This is implemented on ParticleEffect and ParticleEmitter, and returns true while they're emitting and have particles that are still alive. It is also implemented on SoundPoint and returns true while the sound is playing.
The intended usage of this interface is to allow you to check a temporary GameObject to see if it's finished being useful - in a generic way. This is how the TemporaryEffect component works.
Referenced API
Canonical API pages mentioned in this guide.
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.
Allows components to indicate their state in a generic way. This is useful if you have a temporary effect system in which you want to remove GameObjects when their effects have all finished.
If IsToggle is true, this is toggled on press
Should return true if the effect is active in a visible way
True if this channel is fully connnected and fully logged on.
True if press is active. This generally means that the left mouse button is down
If true then we're currently rendering and you are safe to use the contents of this class
If true, the target is bound and active in the scene hierarchy.