The TemporaryEffect class is responsible for destroying a GameObject
after a specified number of seconds. It ensures that if the GameObject
or its children have any components implementing ITemporaryEffect
, it will wait for those effects to complete before proceeding with the destruction. This functionality is particularly useful for scenarios where you want to remove a GameObject
but need to wait for associated sounds or particles to finish.