示例#1
0
 void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
 {
     commandBeingSpawned = spawnCommand(gameObject.GetComponent <TopCommand> ().myCode);
     commandBeingSpawned.transform.SetParent(transform.parent);
     commandBeingSpawned.GetComponent <CanvasGroup> ().blocksRaycasts = false;
     AttackInstructionPanel.outsidePanel = true;
 }
示例#2
0
 void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
 {
     commandBeingDragged = GetComponent <TopCommand> ();
     commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = false;
     AttackInstructionPanel.outsidePanel = false;
     originalSlotHost = commandBeingDragged.GetComponentInParent <AttackTopCommandSlot> ();
 }
示例#3
0
 void IEndDragHandler.OnEndDrag(PointerEventData eventData)
 {
     if (AttackInstructionPanel.outsidePanel)
     {
         originalSlotHost.destructCommand();
     }
     else if (commandBeingDragged.GetComponentInParent <AttackTopCommandSlot> () != originalSlotHost)
     {
         TopCommand newC = Instantiate(Resources.Load("NoActionPrefab", typeof(TopCommand))) as TopCommand;
         newC.transform.SetParent(originalSlotHost.transform);
         commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = true;
     }
     else
     {
         commandBeingDragged.transform.localPosition = Vector2.zero;
         commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = true;
     }
     commandBeingDragged = null;
     originalSlotHost    = null;
 }
示例#4
0
 void IEndDragHandler.OnEndDrag(PointerEventData eventData)
 {
     if (InstructionPanel.outsidePanel)
     {
         ExecuteEvents.Execute <IUpdateNumbers> (numberPanel.gameObject, null, (x, y) => x.UpdateNumbers(false));
     }
     else
     {
         commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = true;
     }
     ExecuteEvents.Execute <IHasFinalised> (playerInstructionPanel.gameObject, null, (x, y) => x.HasFinalised());
     commandBeingDragged = null;
 }
示例#5
0
 void IEndDragHandler.OnEndDrag(PointerEventData eventData)
 {
     if (InstructionPanel.acceptingNewCommand)
     {
         commandBeingSpawned.GetComponent <CanvasGroup> ().blocksRaycasts = true;
         InstantiateSubCommand();
         ExecuteEvents.Execute <IHasFinalised> (targetPanel.gameObject, null, (x, y) => x.HasFinalised());
     }
     else
     {
         Destroy(commandBeingSpawned.gameObject);
     }
     commandBeingSpawned = null;
 }
示例#6
0
 void IEndDragHandler.OnEndDrag(PointerEventData eventData)
 {
     if (commandBeingSpawned.transform.parent == transform.parent)
     {
         Destroy(commandBeingSpawned.gameObject);
     }
     else
     {
         commandBeingSpawned.GetComponent <CanvasGroup> ().blocksRaycasts = true;
         InstantiateSubCommand();
         if (commandBeingSpawned.subCommandRef)
         {
             commandBeingSpawned.subCommandRef.startArguUpdate();
         }
     }
     commandBeingSpawned = null;
 }
示例#7
0
 void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
 {
     commandBeingDragged = gameObject.GetComponent <TopCommand> ();
     commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = false;
 }