Beispiel #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;
 }
Beispiel #2
0
 void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
 {
     commandBeingDragged = GetComponent <TopCommand> ();
     commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = false;
     AttackInstructionPanel.outsidePanel = false;
     originalSlotHost = commandBeingDragged.GetComponentInParent <AttackTopCommandSlot> ();
 }
Beispiel #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;
 }
Beispiel #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;
 }
 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;
 }
Beispiel #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;
 }
Beispiel #7
0
 void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
 {
     commandBeingDragged = gameObject.GetComponent <TopCommand> ();
     commandBeingDragged.GetComponent <CanvasGroup> ().blocksRaycasts = false;
 }