Quit() public method

public Quit ( ) : void
return void
 void UseButton()
 {
     if (Input.GetButton("Fire1") && CheckDelay())
     {
         if (Selection == 1)
         {
             inMenu = false;
             stsc.StartButtonClicked();
         }
         if (Selection == 2)
         {
             sp.ShowOptionsPanel();
             options = true;
         }
         if (Selection == 3)
         {
             sp.ShowScorePanel();
             options = true;
         }
         if (Selection == 4)
         {
             qa.Quit();
         }
     }
 }
Esempio n. 2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.RightArrow))
        {
            if (index < totalButtons - 1)
            {
                index++;
                selection = (selection + 1) % hands.Count;
            }
        }

        if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.LeftArrow))
        {
            if (index > 0)
            {
                index--;
                selection = (selection - 1) % hands.Count;
            }
        }

        if (Input.GetKeyDown(KeyCode.Return))
        {
            for (int i = 0; i < hands.Count; i++)
            {
                if (i == selection && hands[i].name == "StartHand")
                {
                    startOp.StartButtonClicked();
                }
                else if (i == selection && hands[i].name == "ControlsHand")
                {
                    showPanels.ShowOptionsPanel();
                }
                else if (i == selection && hands[i].name == "ExitHand")
                {
                    showPanels.HideOptionsPanel();
                }
                else if (i == selection && hands[i].name == "QuitHand")
                {
                    quitApp.Quit();
                }
                else if (i == selection && hands[i].name == "ResumeHand")
                {
                    pause.UnPause();
                }
                else if (i == selection && hands[i].name == "RestartHand")
                {
                    SceneManager.LoadScene(1);
                }
            }
        }

        UpdateSelection();
    }
    public void yesSelection()
    {
        if (conSelector == 0)
        {
            quitApp.Quit();
        }

        // Save file
        if (conSelector == 1)
        {
            panConfirmation.SetBool("isDisplayed", false);
            saveInformation.saveGame(PanLeftSave.saveSelection);
        }

        if (conSelector == 2)
        {
            panConfirmation.SetBool("isDisplayed", false);
            loadInformation.loadGame(PanLeftSave.loadSelection);
        }

        if (conSelector == 3)
        {
            // throwing items

            GameControl.invSlotArray [LeftPanelInventoryItemUse.itemSelect, 0] = 0;
            GameControl.invSlotArray [LeftPanelInventoryItemUse.itemSelect, 1] = 0;
            panConfirmation.SetBool("isDisplayed", false);
        }

        if (conSelector == 4)
        {
            // unequip items

            addItem.addItemScript();
            GameControl.charEquipment[LeftPanelEquipmentLoad.itemSelection] = 0;
            charSettler.setWeapon();
            charSettler.setArmour();
            charSettler.setHeadEquip();
            charSettler.setFaceEquip();
            charSettler.setNeckEquip();
            charSettler.setShouldersEquip();
            charSettler.setArmsEquip();
            charSettler.setLegsEquip();
            charSettler.setMakeUpEquip();
            setEquip.setEquipModifiers();


            panConfirmation.SetBool("isDisplayed", false);
        }
    }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     //Check if the Cancel button in Input Manager is down this frame (default is Escape key) and that game is not paused, and that we're not in main menu
     if (Input.GetButtonDown("Cancel") && !isPaused && !startScript.inMainMenu)
     {
         //Call the DoPause function to pause the game
         DoPause();
     }
     //If the button is pressed and the game is paused and not in main menu
     else if (Input.GetButtonDown("Cancel") && isPaused && !startScript.inMainMenu)
     {
         //Call the UnPause function to unpause the game
         UnPause();
     }
     if (Input.GetButtonDown("Cancel") && !isPaused && startScript.inMainMenu)
     {
         quitScript.Quit();
     }
 }
Esempio n. 5
0
    public void Start()
    {
        m_ShowPanels = GameObject.Find("Canvas").GetComponent <ShowPanels>();
        m_Quit       = GameObject.Find("Canvas").GetComponent <QuitApplication>();
        m_SoundFx    = GameObject.Find("Canvas/SoundFx").GetComponent <AudioSource>();
        m_Anim       = GetComponent <Animator>();

        onClick.RemoveAllListeners();

        switch (button)
        {
        case ButtonType.Level:
            onClick.AddListener(() => {
                m_SoundFx.clip = soundClip;
                m_SoundFx.Play();
                m_ShowPanels.HideMenu();
                m_ShowPanels.ShowLevelsPanel();
            });
            break;

        case ButtonType.Option:
            onClick.AddListener(() => {
                m_SoundFx.clip = soundClip;
                m_SoundFx.Play();
                m_ShowPanels.ShowOptionsPanel();
                m_ShowPanels.HideMenu();
            });
            break;

        case ButtonType.Quit:
            onClick.AddListener(() => {
                m_SoundFx.clip = soundClip;
                m_SoundFx.Play();
                m_Quit.Quit();
            });
            break;
        }

        m_Anim.SetTrigger("Hide");
    }