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 }
private void Update() { resetViewButton.interactable = !cameraOrbit.IsReset(); if (inCreator) { bool enabled = board.GetNEmitters() == board.GetNReceivers() && board.GetNEmitters() > 0 && !board.AllReceiving(); changeModeButton.GetComponent <Button>().enabled = enabled; changeModeButton.GetComponent <Image>().color = enabled ? Color.white : Color.red; } else if (board.BoardCompleted() && !completed) { completed = true; endPanel.SetActive(true); blackRect.SetActive(true); streamRoom.FinishLevel(); ProgressManager.Instance.UserCreatedLevel(initialState.ToJson()); string levelName = GameManager.Instance.GetCurrentLevelName(); TrackerAsset.Instance.setVar("steps", board.GetCurrentSteps()); TrackerAsset.Instance.Completable.Completed(levelName, CompletableTracker.Completable.Level, true, -1f); } }