Exemplo n.º 1
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            _tempCargoHandler = collision.GetComponent <ISpaceshipCargoHandler>();
            if (_tempCargoHandler != null && _tempCargoHandler.CheckCargo())
            {
                _tempCargoHandler.DeliverCargo(this);
                ObjectPooler.Instance.DestroyObject(_tempCargoHandler.GetUnityObject());
                StatsSystem.Instance.ReduceActiveShipsCount();
                return;
            }

            _tempCargoHandler = null;
        }