Пример #1
0
 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);
 }
Пример #2
0
    private void ReturnToPool(Fog fog)
    {
        fog.Destriction -= ReturnToPool;
        IsHaveFog        = false;
        ReturningToPool?.Invoke(this);

        if (_spawner != null)
        {
            Destroy(_spawner.gameObject);
        }
        _pool.ReturnToPool(this);
        ReturningToPool = null;
    }
Пример #3
0
    public void ReturnToPool(Vector3 poolPosition)
    {
        IsHaveFog   = false;
        IsInThePool = true;
        ReturningToPool?.Invoke(this);
        ReturningToPool = null;
        if (_spawner != null)
        {
            Destroy(_spawner.gameObject);
        }

        SetPosition(poolPosition);
    }