private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag != Constans.POWER_UP_TAG) { return; } PowerUpView powerUp = collision.gameObject.GetComponent <PowerUpView>(); if (powerUp == null) { return; } if (player == null) { return; } powerUp.ActivatePowerUp(player); }
public PowerUpPresenter(PowerUpView view, RemoveCollision removeCollision) { this.view = view; this.removeCollision = removeCollision; }
public void Execute(PowerUpView powerUpView, PlayerView playerView) { powerUpView.DestroyView(); playerView.EnhanceGun(); }
public static PowerUpPresenter Provide(PowerUpView view) { return(new PowerUpPresenter(view, GameProvider.ProvideRemoveCollision())); }