Exemplo n.º 1
0
 public void InitThelmore()
 {
     if (TOWN == null)
     {
         TOWN = this;
     }
     else
     {
         Destroy(this);
     }
     //Initialize time system
     TimeManager.AdvanceTime(0f);
     //Initialize status bar
     StatusBar.GetComponent <StatusBarManager>().UpdateStatusBar();
     //Set Store Button bools based on loaded SaveGame
     showBank = false;  if (SaveGame.current.TAGS.Contains("Thelmore_Bank_Open"))
     {
         showBank = true;
     }
     showBarracks = false;  if (SaveGame.current.TAGS.Contains("Thelmore_Barracks_Open"))
     {
         showBarracks = true;
     }
     showInn = false;  if (SaveGame.current.TAGS.Contains("Thelmore_Inn_Open"))
     {
         showInn = true;
     }
     showRoad = false;  if (SaveGame.current.TAGS.Contains("Thelmore_Road_Open"))
     {
         showRoad = true;
     }
     showSmith = false; if (SaveGame.current.TAGS.Contains("Thelmore_Smith_Open"))
     {
         showSmith = true;
     }
     showTavern = false; if (SaveGame.current.TAGS.Contains("Thelmore_Tavern_Open"))
     {
         showTavern = true;
     }
     showTemple = false;  if (SaveGame.current.TAGS.Contains("Thelmore_Temple_Open"))
     {
         showTemple = true;
     }
     showItemShop = false; if (SaveGame.current.TAGS.Contains("Thelmore_Tools_Open"))
     {
         showItemShop = true;
     }
     showTownHall = false; if (SaveGame.current.TAGS.Contains("Thelmore_TownHall_Open"))
     {
         showTownHall = true;
     }
     showVoncar = false; if (SaveGame.current.TAGS.Contains("Thelmore_Magic_Open"))
     {
         showVoncar = true;
     }
     showWell = false; if (SaveGame.current.TAGS.Contains("Thelmore_Well_Open"))
     {
         showWell = true;
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (Controllers.GetButton(1, "Start", 1) & canPause)
        {
            if (isPaused)
            {
                ResumeGame();
            }
            else
            {
                isPaused = true;
                pauseMenu.SetActive(true);
                Time.timeScale = 0f;
                //RefreshMenu(index);
            }
        }

        /*
         * if ((isPaused & canPause) || !canPause)
         * {
         *  //print(returnedToCenter);
         *  //print(Controllers.GetJoystick(1, 1));
         *  //Controllers.GetJoystick(1, 1);
         *  if (returnedToCenter)
         *  {
         *      if (Controllers.GetJoystick(1, 1).y > 0 & index != 0)
         *      {
         *          returnedToCenter = false;
         *          index--;
         *      }
         *      else if (Controllers.GetJoystick(1, 1).y < 0 & index < menuSize - 1)
         *      {
         *          returnedToCenter = false;
         *          index++;
         *      }
         *      //RefreshMenu(index);
         *  }
         *  else
         *  {
         *      returnedToCenter = Controllers.JoystickReturnedCenter(1, 1);
         *  }
         *
         *
         *  if (Controllers.GetButton(1, "A", 2) & canPause)
         *  {
         *      switch (index)
         *      {
         *          case 0:
         *              ResumeGame();
         *              break;
         *          case 1:
         *              ReturnToTitle();
         *              break;
         *      }
         *  }
         *  else if (Controllers.GetButton(1, "A", 2) & !canPause)
         *  {
         *      switch (index)
         *      {
         *          case 0:
         *              NewGame();
         *              break;
         *          case 1:
         *              LoadGame();
         *              break;
         *          case 2:
         *              ExitGame();
         *              break;
         *      }
         *  }
         * }
         */
        /*
         * if (Controllers.GetButton(1, "Y", 1))
         * {
         *  deadScreen = true;
         * }
         */


        if (deadScreen || initialDeadCount || finalDeadCount || deadScreenCount)
        {
            if (deadScreen)
            {
                deadScreen       = false;
                initialDeadCount = true;
                tm.StartTime(initialDeadTime);
                deadScreenGO.SetActive(true);
                blackScreen.color = new Color(1f, 1f, 1f, 0f);
                redText.color     = new Color(170f / 255f, 0f, 0f, 0f);
            }
            else if (initialDeadCount)
            {
                //advance deadScreen start
                FadeIn();

                if (tm.IsTimeOverNoUpdate())
                {
                    initialDeadCount = false;
                    deadScreenCount  = true;
                    tm.StartTime(deadScreenTime);
                }
            }
            else if (deadScreenCount)
            {
                if (tm.IsTimeOverNoUpdate())
                {
                    deadScreenCount = false;
                    finalDeadCount  = true;
                    tm.StartTime(finalDeadTime);
                }
            }
            else if (finalDeadCount)
            {
                // advance deadScreen end
                FadeOut();

                if (tm.IsTimeOverNoUpdate())
                {
                    finalDeadCount = false;
                    SceneManager.LoadScene(titleScene);
                }
            }

            tm.AdvanceTime();
        }
    }