Beispiel #1
0
 /// <summary>
 /// Game menu RESTART functionalities
 /// </summary>
 /// YES BUTTON
 public void RestartYes()
 {
     MainGameLogic.GetMainCamera().GetComponent <MainMenuHandler>().StartGame();
     gameMenuCanvas.SetActive(false);
     confirmationCanvas.SetActive(false);
     MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_GAME);
 }
Beispiel #2
0
 private void StartFinishAnim()
 {
     Reset();
     bStartedFinishAnimation = true;
     magicCube = GameObject.FindGameObjectWithTag("MagicCube");
     MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.FINISH_CANVAS);
 }
Beispiel #3
0
 internal void OpenFinishCanvas()
 {
     if (MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager().IsCurrentActionDone())
     {
         finishCanvas.GetComponent <FinishCanvasHandler>().Init(CloseFinishCanvas, FinishRestart, FinishMainMenu);
         finishCanvas.SetActive(true);
         MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.FINISH_CANVAS);
     }
 }
Beispiel #4
0
 internal void OpenGameMenu()
 {
     if (MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager().IsCurrentActionDone())
     {
         gameMenuCanvas.GetComponent <GameMenuBehaviour>().Init(CloseGameMenu, ShowHideGameTimer, RestartGame, MainMenuGame);
         gameMenuCanvas.SetActive(true);
         MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.GAME_MENU);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Game menu MAIN MENU functionalities
 /// </summary>
 /// YES BUTTON
 public void MainMenuYes()
 {
     confirmationCanvas.SetActive(false);
     gameMenuCanvas.SetActive(false);
     MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager().Save();
     MainGameLogic.GetMainCamera().GetComponent <MainMenuHandler>().Reset();
     mainMenuCanvas.SetActive(true);
     mainGameUI.SetActive(false);
     MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_MENU);
 }
Beispiel #6
0
 /// <summary>
 /// Finish MAIN MENU functionalities
 /// </summary>
 /// YES BUTTON
 public void FinishMainMenuYes()
 {
     finishCanvas.SetActive(false);
     confirmationCanvas.SetActive(false);
     gameMenuCanvas.SetActive(false);
     MainGameLogic.GetMainCamera().GetComponent <MainMenuHandler>().Reset();
     mainMenuCanvas.SetActive(true);
     mainGameUI.SetActive(false);
     MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_MENU);
 }
Beispiel #7
0
    public void StartGame()
    {
        MainGameLogic.GetMainCamera().GetComponent <CubeControl>().CreateMagicCube(Mathf.RoundToInt(cubeSizeSlider.value));
        MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_GAME);
        MainGameLogic.LinkMagicCubeManagerAndUI(MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager(), MainGameLogic.GetMainCamera().GetComponent <UIManager>().GetMainGameUI());
        MainGameLogic.LinkMagicCubeManagerAndFinish(MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager(), MainGameLogic.GetMainCamera().GetComponent <UIManager>().GetFinishCanvas());

        MainGameLogic.GetMainCamera().GetComponent <UIManager>().MainMenuToGame();
        MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager().InitRandomMoves(2.7f);
    }
Beispiel #8
0
    public void LoadGame()
    {
        try
        {
            MagicCubeSaveData savedata = MainGameLogic.LoadGameSave();

            MainGameLogic.GetMainCamera().GetComponent <CubeControl>().CreateMagicCube(savedata.magicCubeSize);
            MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_GAME);
            MainGameLogic.LinkMagicCubeManagerAndUI(MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager(), MainGameLogic.GetMainCamera().GetComponent <UIManager>().GetMainGameUI());
            MainGameLogic.LinkMagicCubeManagerAndFinish(MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager(), MainGameLogic.GetMainCamera().GetComponent <UIManager>().GetFinishCanvas());
            MainGameLogic.GetMainCamera().GetComponent <CubeControl>().GetMagicCubeManager().LoadGame(savedata);

            MainGameLogic.GetMainCamera().GetComponent <UIManager>().MainMenuToGame();
        }
        catch (Exception e)
        {
            StartGame();
        }
    }
Beispiel #9
0
 /// <summary>
 /// Finish Canvas functionalities
 /// </summary>
 public void CloseFinishCanvas()
 {
     finishCanvas.SetActive(false);
     MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_GAME);
 }
Beispiel #10
0
 /// <summary>
 /// Game menu functionalities
 /// </summary>
 public void CloseGameMenu()
 {
     gameMenuCanvas.SetActive(false);
     MainGameLogic.SetCurrentActiveElement(MainGameLogic.CurrentActiveElement.MAIN_GAME);
 }