Пример #1
0
    void Start()
    {
        //------------------Set up orentation--------------------------
        DeviceOrientation orientation = Input.deviceOrientation;

        if (orientation == DeviceOrientation.LandscapeLeft)
        {
            Screen.orientation = ScreenOrientation.LandscapeLeft;
        }
        else if (orientation == DeviceOrientation.LandscapeRight)
        {
            Screen.orientation = ScreenOrientation.LandscapeRight;
        }
        //------------------------------------------------------------
        if (buildVersion != 2)
        {
            //only show exit button for standalone
            exitButton.SetActive(false);
        }
        chapterManager.SetUp();
        levelManager.SetUp(chapterManager);
        levelEditor.SetUp();
        tutorialManager.SetUp(this);

        //levelManager.LoadCustomLevels(0);
        menuManager.ToTitle();

        //unit test
        Debug.Log(TAG + "0 + 2 should be 2 is: " + Calc.ModThree(0, 2));
        Debug.Log(TAG + "5 - 2 should be 3 is: " + Calc.ModThree(5, 2));

        //Find the edge of the screen
        if (ProgressManager.GetDebug())
        {
            debugManager = menuManager.CreateDebug();
        }



        //Level l = levelManager.GetLevel();
        //gridManager.CreateGrid(l);
        //toolManager.SetUp(l);
    }
Пример #2
0
    public void StartGame(int chapterNum, int levelNum, bool isCustom)
    {
        Debug.Log(TAG + "starting game.");
        ClearGame();

        //levelManager.GetLevels()[i];
        Level level = levelManager.GetLevel(chapterNum, levelNum, isCustom);      //sets cur level and folder as well

        gridManager.CreateGrid(level, editMode);
        menuManager.ToGamePlay();
        int numOfTools = toolManager.SetUp(level);

        tutorialManager.CheckTutorial(level, numOfTools);

        //soundManager.SetCurChord(0);
        soundManager.SetStartChord(numOfTools);
        soundManager.CheckLastLevel(levelManager, chapterNum, level, isCustom);     //checks if should play credits music

        if (ProgressManager.GetDebug())
        {
            debugManager.SetUp(level.GetFileName(), chapterNum, levelNum);
        }
        if (chapterNum == 0 && levelNum == 0)
        {
            //is the first level of first chapter
            //show some arrows
            GameObject g = Instantiate(pointersPrefab);
            tutorialPointers = g.GetComponent <TutorialPointers>();
            return;
        }
        //if it is not the first level
        if (tutorialPointers != null)
        {
            tutorialPointers.End();
        }
    }