Exemple #1
0
        void Start()
        {
            Destroy(GameObject.Find("GameController"));
            Destroy(GameObject.Find("CheckForInteraction"));
            Destroy(GameObject.Find("InventoryHandler"));

            StatKeeper.ResetStats();
            InventoryHandler.resetInventory();

            PlayButton     = GameObject.Find("Play").GetComponent <Button>();
            AboutButton    = GameObject.Find("About").GetComponent <Button>();
            QuitButton     = GameObject.Find("Quit").GetComponent <Button>();
            HelpButton     = GameObject.Find("Help").GetComponent <Button>();
            continueButton = GameObject.Find("HelpToggle/ContinueButton").GetComponent <Button>();

            AboutToggle = GameObject.Find("AboutToggle");
            ImageToggle = GameObject.Find("ImageToggle");
            HelpToggle  = GameObject.Find("HelpToggle");

            continueButton.onClick.AddListener(() => startSound());

            PlayButton.onClick.AddListener(() => beginGame());
            AboutButton.onClick.AddListener(() => toggleAbout());
            QuitButton.onClick.AddListener(() => Application.Quit());
            HelpButton.onClick.AddListener(() => toggleHelp());

            AboutToggle.SetActive(false);
            HelpToggle.SetActive(false);
            continueButton.gameObject.SetActive(false);
        }
        //Continues the story onward

        /* private void continueStory(int window) {
         *
         *      if (window == 1) {
         *
         *              disableAllWindows ();
         *
         *              EnterCastle.SetActive (true);
         *      }
         *
         *      if (window == 2) {
         *
         *              disableAllWindows ();
         *
         *              MladyIntro.SetActive (true);
         *
         *      }
         *
         *      if (window == 3) {
         *
         *              disableAllWindows ();
         *
         *              MladyGood.SetActive (true);
         *
         *      }
         *
         *      if (window == 4) {
         *
         *              disableAllWindows ();
         *
         *              MladyBad.SetActive (true);
         *
         *      }
         *
         * } */

        //Continues the story onward
        private void continueStory(int window)
        {
            int switchValue = window;

            switch (switchValue)
            {
            case 1:

                disableAllWindows();

                EnterCastle.SetActive(true);

                break;

            case 2:

                disableAllWindows();

                if (InventoryHandler.roseAlreadyUsed())
                {
                    GiveRoseButton.enabled = false;
                }

                MladyIntro.SetActive(true);

                break;

            case 3:

                disableAllWindows();

                MladyGood.SetActive(true);

                break;

            case 4:

                disableAllWindows();

                MladyBad.SetActive(true);

                break;

            case 5:

                disableAllWindows();

                break;

            case 6:

                disableAllWindows();

                break;
            }
        }
Exemple #3
0
        //Continues the game and revives the player
        public void ContinueGame()
        {
            playerDed = false;
            StatKeeper.healPlayer();

            Debug.Log("Continuing game from the checkpoint");

            StatKeeper.resetHoboCoin();
            InventoryHandler.resetInventory();

            SceneManager.LoadScene(3);
        }
Exemple #4
0
        //Continues the story onward based on players choices
        private void continueStory(int window)
        {
            int switchValue = window;

            switch (switchValue)
            {
            case 1:

                disableAllWindows();

                EnterCastle.SetActive(true);

                break;

            case 2:

                disableAllWindows();

                if (InventoryHandler.roseAlreadyUsed())
                {
                    GiveRoseButton.enabled = false;
                    GiveRose.SetActive(false);
                }

                MladyIntro.SetActive(true);

                break;

            case 3:

                disableAllWindows();

                MladyGood.SetActive(true);

                break;

            case 4:

                disableAllWindows();

                MladyBad.SetActive(true);

                break;

            case 5:

                disableAllWindows();

                SoundManager.instance.musicSource.Stop();

                SoundManager.instance.musicSource.PlayOneShot(goodEnding, 1.0f);

                GoodEnding.SetActive(true);

                Invoke("displayStats", 10);

                break;

            case 6:

                disableAllWindows();

                SoundManager.instance.musicSource.Stop();

                SoundManager.instance.musicSource.PlayOneShot(badEnding, 1.0f);

                BadEnding.SetActive(true);

                Invoke("displayStats", 10);

                break;
            }
        }