Exemplo n.º 1
0
    //Public functions for keypress actions so that they can be reused for the UI button presses

    public void Cancel()
    {
        if (selectedObjectToBuild == true)
        {
            //Cancels tower/wall location selection

            Debug.Log("CANCEL SELECTED TOWER");
            selectedObjectToBuild = false;
            mFunc.Mode            = 0;   //Shows mouse cursor
            Destroy(mFunc.SelHighlight); //Destroys the green highlight selection box
            sourceSFX.PlayOneShot(UIClickFX);
        }
        else if (this.mode == 1 && selectedObjectToBuild == false)
        {
            //Cancels building this.mode
            buildButton.BuildToggle();
            Debug.Log("CANCEL BUILDING");
            this.mode = 0;
            sourceSFX.PlayOneShot(UIClickFX);
            Cursor.SetCursor(normalCursor, hotSpot, cursorMode);
        }
        else if (this.mode == 2)
        {
            //Cancels sending this.mode
            sendButton.SendToggle();
            sourceSFX.PlayOneShot(UIClickFX);
            Debug.Log("CANCEL SENDING");
            this.mode = 0;
            Cursor.SetCursor(normalCursor, hotSpot, cursorMode);
        }
    }
Exemplo n.º 2
0
 public void SendToggle()
 {
     if (kf.Mode == 2)
     {
         potatoButton.interactable    = false;
         cloudButton.interactable     = false;
         paladinButton.interactable   = false;
         vampireButton.interactable   = false;
         mercyButton.interactable     = false;
         reinhardtButton.interactable = false;
         kf.CancelSend();
     }
     else if (kf.Mode == 1)
     {
         buildButton.BuildToggle();
         potatoButton.interactable    = true;
         cloudButton.interactable     = true;
         paladinButton.interactable   = true;
         vampireButton.interactable   = true;
         mercyButton.interactable     = true;
         reinhardtButton.interactable = true;
         kf.Send();
     }
     else if (kf.Mode == 0)
     {
         kf.Send();
         potatoButton.interactable    = true;
         cloudButton.interactable     = true;
         paladinButton.interactable   = true;
         vampireButton.interactable   = true;
         mercyButton.interactable     = true;
         reinhardtButton.interactable = true;
     }
 }