コード例 #1
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);
    }
コード例 #2
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();
        }
    }