Ejemplo n.º 1
0
 public void OnUpdate(float deltaTime)
 {
     toPosition.Do(target =>
     {
         var speed             = SpeedMultiplier * deltaTime;
         var currentPosition   = view.GetScreenPosition();
         var transformPosition = Vector2.MoveTowards(currentPosition, target, speed);
         view.SetAnchoredPosition(transformPosition);
         var distance = Vector2.Distance(currentPosition, target);
         if (distance <= 0.01f)
         {
             removeCollision.Execute(view);
             view.DestroyView();
         }
     });
 }
Ejemplo n.º 2
0
 public void Execute(PowerUpView powerUpView, PlayerView playerView)
 {
     powerUpView.DestroyView();
     playerView.EnhanceGun();
 }