예제 #1
0
    /// <summary>
    /// Spawn동작 종료시 호출. 리소스 반환을 위해 반드시 호출하는 것을 권장.
    /// </summary>
    public override void Finish()
    {
        if (asSpawnedObject != null)
        {
            asSpawnedObject.OnDespawn();
            asSpawnedObject = null;
        }

        if (asPooledObject != null)
        {
            PoolManager.GetOrCreate(PrefabName).Dispose(asPooledObject);
            asPooledObject = null;
            return;
        }

        IsActive = false;
    }