internalDespawnAfterDelay() private method

internal coroutine for despawning after a delay
private internalDespawnAfterDelay ( GameObject go, float delayInSeconds ) : IEnumerator
go GameObject Go.
delayInSeconds float Delay in seconds.
return IEnumerator
Beispiel #1
0
    /// <summary>
    /// sticks the GameObject back into it's recycle bin after a delay. If the GameObject has no bin it is destroyed.
    /// </summary>
    /// <param name="go">Go.</param>
    public static void despawnAfterDelay(GameObject go, float delayInSeconds)
    {
        if (go == null)
        {
            return;
        }

        instance.StartCoroutine(instance.internalDespawnAfterDelay(go, delayInSeconds));
    }