Ejemplo n.º 1
0
 public override void OnDrop(PointerEventData eventData)
 {
     if (PlayController.Instance.CurrentState == PlayState.AssignDamage && DraggableElement.DragItem.GetComponent <CardBehaviour>())
     {
         CardBehaviour DroppedCard = DraggableElement.DragItem.GetComponent <CardBehaviour>();
         ObstacleData  Obstacle    = Data as ObstacleData;
         Obstacle.OnCardDroppedOn(DroppedCard.Data);
         DroppedCard.RegisterDragCallback(delegate
         {
             Obstacle.OnUnassign(DroppedCard.Data);
         });
     }
     else
     {
         CardBehaviour DroppedCard = DraggableElement.DragItem.GetComponent <CardBehaviour>();
         if (DroppedCard == null)
         {
             return;
         }
         DroppedCard.ZoneAt.OnDrop(eventData);
     }
 }