Exemplo n.º 1
0
 public void MovementButtonPress()
 {
     gridColor = 0;
     action    = 'm';
     if (!canBeCancelled && !canBeUndone)
     {
         foreach (Button b in actionButton)
         {
             if (b != null && b != actionButton[0])
             {
                 b.interactable = false;
             }
         }
         floorHandler.ToggleMovementGrid(activeChar, true);
         actionButton[0].GetComponentInChildren <TextMeshProUGUI>().text = "cancel";
         canBeCancelled = true;
         //actionButton[0].interactable = false;
     }
     else if (canBeCancelled)
     {
         foreach (Button b in actionButton)
         {
             if (b != null && b != actionButton[0])
             {
                 b.interactable = true;
             }
         }
         floorHandler.ToggleMovementGrid(activeChar, false);
         actionButton[0].GetComponentInChildren <TextMeshProUGUI>().text = "movement";
         canBeCancelled = false;
     }
     else if (canBeUndone)
     {
         foreach (Button b in actionButton)
         {
             if (b != null && b != actionButton[0])
             {
                 b.interactable = false;
             }
         }
         activeChar.go.GetComponent <IsoTransform>().Position = floorHandler.originalCharPos;
         StopCoroutine(floorHandler.MoveClick(floorHandler.lastClicked));
         floorHandler.ToggleMovementGrid(activeChar, true);
         actionButton[0].GetComponentInChildren <TextMeshProUGUI>().text = "cancel";
         canBeCancelled = true;
         canBeUndone    = false;
     }
 }