Description
The CreateOrphans
method is a static method of the TemporaryEffect
class. It is used to examine the children of a specified GameObject
and orphan any temporary effects. This method is particularly useful when you want to ensure that temporary effects are not tied to the lifecycle of their parent GameObject
.
Usage
To use the CreateOrphans
method, you need to pass a GameObject
instance and a boolean value indicating whether to disable looping effects. If disableLooping
is set to true
, any looping effects will be disabled when orphaned.
Example
// Example usage of CreateOrphans method
GameObject myGameObject = new GameObject();
// Orphan temporary effects from myGameObject
TemporaryEffect.CreateOrphans(myGameObject, true);