Beispiel #1
0
    private void Update()
    {
        if (boardManager == null)
        {
            return;
        }

        if (boardManager.GetCurrentSteps() > minimosPasos + pasosOffset)
        {
            starsController.DeactivateMinimumStepsStar(boardManager.GetCurrentSteps() - (minimosPasos + pasosOffset));
        }


        if (boardManager.BoardCompleted() && !endPanel.activeSelf && !endPanelMinimized.activeSelf)
        {
            string levelName = GameManager.Instance.GetCurrentLevelName();


            streamRoom.FinishLevel();

            endPanel.SetActive(true);
            blackRect.SetActive(true);
            if (!GameManager.Instance.InCreatedLevel())
            {
                TrackerAsset.Instance.setVar("steps", boardManager.GetCurrentSteps());
                TrackerAsset.Instance.setVar("first_execution", starsController.IsFirstRunStarActive());
                TrackerAsset.Instance.setVar("minimum_steps", starsController.IsMinimumStepsStarActive());
                TrackerAsset.Instance.setVar("no_hints", starsController.IsNoHintsStarActive());
                ProgressManager.Instance.LevelCompleted(starsController.GetStars());
            }
            else
            {
                TrackerAsset.Instance.Completable.Completed(levelName, CompletableTracker.Completable.Level, true, -1);
            }

            completed = true;
        }

#if UNITY_EDITOR
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.N))
        {
            LoadNextLevel();
        }
#endif
    }