コード例 #1
0
 public void goToPointId(int targetPointId, LevelButtonController targetLevelController, float delay = 0)
 {
     mTargetPointId         = targetPointId;
     mTargetLevelController = targetLevelController;
     mNextPointId           = mCurrentPointId + 1;
     mDelay = delay;
 }
コード例 #2
0
ファイル: ChapterMenu.cs プロジェクト: unnameR/SomeWork
    void Init()
    {
        float progressPercent = (float)chapter.progress / (chapter.levels.Length * 3);

        chapterTxt.text           = chapter.chapterName;
        progressTxt.text          = (progressPercent * 100).ToString("f0") + "%";
        progressBarImg.fillAmount = (float)chapter.progress / (chapter.levels.Length * 3);
        oldActiveLevel            = levelButtons[0];

        for (int i = 0; i < levelButtons.Length; i++)
        {
            levelButtons[i].LoadStat(chapter.levels[i]);
        }

        GameLevelSO[] levelsComplete = System.Array.FindAll(chapter.levels, a => a.isLevelComplete);
        bossUnlockTxt.text = levelsComplete.Length + "/" + chapter.bossUnlockLevelCount;
        if (levelsComplete.Length >= chapter.bossUnlockLevelCount)
        {
            chapter.levels[8].isLevelLock = false;//гавнецо, сделать нормально.
            bossLockLevel.SetActive(false);
            bossAnim.SetTrigger("unlock");
        }

        ActiveLevel(0);
    }
コード例 #3
0
    void onDone()
    {
        GameAssets.CurrentLevelIndex = mTargetLevelController.levelIndex;
        GoToGame();

        mTargetLevelController = null;
        mTargetPointId         = -1;
        mNextPointId           = -1;

        //UIController.Instance.GoToLevel (mTargetLevel);
    }
コード例 #4
0
ファイル: ChapterMenu.cs プロジェクト: unnameR/SomeWork
    public void ActiveLevel(int number)
    {
        if (chapter.levels[number].isLevelLock)
        {
            return;
        }

        activeLevel = number;
        oldActiveLevel.ActiveLevel(false);
        levelButtons[number].ActiveLevel(true);
        oldActiveLevel = levelButtons[number];
    }
コード例 #5
0
    void updateAvatarPosition()
    {
        try
        {
            int lastPlayingLevelIndex = UsersController.Instance.userData().getLastPlayingLevel();

            GameObject            stationGO         = GameObject.Find("Pin - Level " + lastPlayingLevelIndex);
            LevelButtonController stationController = stationGO.GetComponent <LevelButtonController>();

            avatar.jumpToPointId(stationController.ColliderPointId);

            btnCollection.interactable  = false;
            btnPreferences.interactable = false;
        }
        catch
        {
            btnCollection.interactable  = true;
            btnPreferences.interactable = true;
            Debug.Log("Error to locate avatar");
        }
    }
コード例 #6
0
    void moveAvatarToNextPosition()
    {
        if (GameAssets.NextLevelIndex != -1)
        {
            int NextLevelIndex        = GameAssets.NextLevelIndex;
            int highestOpenLevel      = UsersController.Instance.userData().getHighestOpenLevel();
            int lastPlayingLevelIndex = UsersController.Instance.userData().getLastPlayingLevel();

            if (NextLevelIndex > highestOpenLevel)
            {
                NextLevelIndex = highestOpenLevel;
            }

            GameObject            stationGO         = GameObject.Find("Pin - Level " + lastPlayingLevelIndex);
            LevelButtonController stationController = stationGO.GetComponent <LevelButtonController>();

            LevelButtonController[] allStations = GetComponentsInChildren <LevelButtonController>();

            btnCollection.interactable  = false;
            btnPreferences.interactable = false;

            foreach (LevelButtonController st in allStations)
            {
                st.setNotActive();
            }

            stationGO         = GameObject.Find("Pin - Level " + NextLevelIndex);
            stationController = stationGO.GetComponent <LevelButtonController>();
            avatar.goToPointId(stationController.ColliderPointId, stationController, 0.5f);

            GameAssets.NextLevelIndex = -1;
        }
        else
        {
            btnCollection.interactable  = true;
            btnPreferences.interactable = true;
        }
    }