private void Despawn(SpawnableObject spawnableObject) { spawnableObject.Deactivated -= OnObjectDeactivated; _activeObjects.Remove(spawnableObject); _objectsPool.Return(spawnableObject); }
private void OnObjectDeactivated(SpawnableObject spawnableObject) { Despawn(spawnableObject); }