public bool Initialize() { BirdHitHandler = new BirdHitEvent(); BirdHitHandler.AddListener(x => Debug.Log($"{x.ClipUrl} was hit")); ReturningToPoolHandler = new ReturningToPool(); ReturningToPoolHandler.AddListener(x => Debug.Log($"{x.name} returned to its pool")); return(true); }
private void ReturnToPool(Fog fog) { fog.Destriction -= ReturnToPool; IsHaveFog = false; ReturningToPool?.Invoke(this); if (_spawner != null) { Destroy(_spawner.gameObject); } _pool.ReturnToPool(this); ReturningToPool = null; }
public void ReturnToPool(Vector3 poolPosition) { IsHaveFog = false; IsInThePool = true; ReturningToPool?.Invoke(this); ReturningToPool = null; if (_spawner != null) { Destroy(_spawner.gameObject); } SetPosition(poolPosition); }