private void OnEnable() { if (GameManager.Instance.CurrentPlayer.currentChallengeGems > GameManager.Instance.CurrentPlayer.currentChallengeBestResultGems) { GameManager.Instance.CurrentPlayer.currentChallengeBestResultGems = GameManager.Instance.CurrentPlayer.currentChallengeGems; } bestResultGemsTxt.text = GameManager.Instance.CurrentPlayer.currentChallengeBestResultGems.ToString(); currentResultGemsTxt.text = GameManager.Instance.CurrentPlayer.currentChallengeGems.ToString(); var definition = EnglishGoConstants.GetChallengePointDefinitions() .Find(x => x.id == GameManager.Instance.CurrentPlayer.afterChallenge); if (definition.maxReward == GameManager.Instance.CurrentPlayer.currentChallengeBestResultGems) { maxScoreAchievedTxt.gameObject.SetActive(true); } else if (definition.maxAttemps == GameManager.Instance.CurrentPlayer.currentMissionChallengesAttempts) { noMoreAttemptsTxt.gameObject.SetActive(true); } else { doItBetterTxt.gameObject.SetActive(true); } }
private void Start() { player = GameManager.Instance.CurrentPlayer; Assert.IsNotNull(player); challengePointDefinitions = EnglishGoConstants.GetChallengePointDefinitions(); for (int i = 0; i < challengePoints.Length; i++) { InstantiateTeacher(challengePoints[i]); } }
private void OnEnable() { GameManager.Instance.CurrentPlayer.menusLoadBlocked = true; var definition = EnglishGoConstants.GetChallengePointDefinitions() .Find(x => x.id == GameManager.Instance.CurrentPlayer.challengeGetCloser); gemsReward.text = definition.maxReward.ToString(); coinsCost.text = definition.coinsCost.ToString(); attemptsTxt.text = GameManager.Instance.CurrentPlayer.currentMissionChallengesAttempts + " / " + definition.maxAttemps; }
private void Update() { // if current mission is _id_ then load the challenge points for that mission if (GameManager.Instance.CurrentPlayer.currentMission != String.Empty) { foreach (var challengePoint in liveChallengePoints) { if (challengePoint.MissionId == GameManager.Instance.CurrentPlayer.currentMission) { var definition = EnglishGoConstants.GetChallengePointDefinitions() .Find(x => x.id == GameManager.Instance.CurrentPlayer.currentMission); if (definition.maxAttemps > GameManager.Instance.CurrentPlayer.currentMissionChallengesAttempts) { challengePoint.gameObject.SetActive(true); var position = abstractMap.GeoToWorldPosition(new Vector2d(challengePoint.latitude, challengePoint.longitude)); challengePoint.transform.localPosition = new Vector3(position.x, 1.2f, position.z); } else { challengePoint.gameObject.SetActive(false); } } else { challengePoint.gameObject.SetActive(false); } } } else { foreach (var challengePoint in liveChallengePoints) { challengePoint.gameObject.SetActive(false); } } }