private void GeneratePacksFromUnlockFunction(JourneyPosition journeyPosition, List <RewardPack> jpPacks) { // Non-assessment PS do not generate any reward if (!journeyPosition.IsAssessment()) { return; } // Force to unlock a prop and all its colors at the first JP if (journeyPosition.Equals(new JourneyPosition(1, 1, 100))) { jpPacks.AddRange(GenerateNewRewardPacks(RewardBaseType.Prop, RewardUnlockMethod.NewBaseAndAllColors)); return; } // Else, randomly choose between locked props, decals, or textures int nDecalsLeft = GetAllRewardPacksOfBaseType(RewardBaseType.Decal).Count(x => x.IsLocked); int nTexturesLeft = GetAllRewardPacksOfBaseType(RewardBaseType.Texture).Count(x => x.IsLocked); int nPropsLeft = GetAllRewardPacksOfBaseType(RewardBaseType.Prop, true).Count(x => x.IsLocked); //Debug.Log("We have left: " + nDecalsLeft + " decals, " + nTexturesLeft + " textures, " + nPropsLeft + " props"); List <RewardBaseType> choices = new List <RewardBaseType>(); if (nDecalsLeft > 0) { choices.Add(RewardBaseType.Decal); } if (nTexturesLeft > 0) { choices.Add(RewardBaseType.Texture); } if (nPropsLeft > 0) { choices.Add(RewardBaseType.Prop); } RewardBaseType choice = choices.RandomSelectOne(); if (choice == RewardBaseType.Prop) { jpPacks.AddRange(GenerateNewRewardPacks(choice, RewardUnlockMethod.NewBaseAndAllColors)); } else { jpPacks.AddRange(GenerateNewRewardPacks(choice, RewardUnlockMethod.BaseColorCombo)); } }
public void Initialise(JourneyPosition _journeyPosition, PlaySessionState _playSessionState) { journeyPosition = _journeyPosition; playSessionState = _playSessionState; HandleJourneyPosition(journeyPosition); HandlePlaySessionState(playSessionState); // @note: we do not show the JourneyPos text now journeyPosTextUI.gameObject.SetActive(false); if (journeyPosition.IsAssessment()) { starsPivotGO.SetActive(false); } }
public void Initialise(int _pinIndex, JourneyPosition _journeyPosition) { pinIndex = _pinIndex; journeyPosition = _journeyPosition; name = "Pin_" + _journeyPosition; // Road sign when a new LB starts var prevJP = AppManager.I.JourneyHelper.FindPreviousJourneyPosition(journeyPosition); roadSignGO.SetActive(prevJP == null || prevJP.LearningBlock != journeyPosition.LearningBlock); roadSignTextUI.SetText(journeyPosition.ToDisplayedString(false)); // Choosing the correct PIN based on the journey position pinV1.gameObject.SetActive(false); pinV2.gameObject.SetActive(false); pinAssessment.gameObject.SetActive(false); if (journeyPosition.IsEndGame()) { currentPinGO = pinEndGame; } else if (journeyPosition.IsRecap()) { currentPinGO = pinRecap; } else if (journeyPosition.IsAssessment()) { currentPinGO = pinAssessment; } else { currentPinGO = journeyPosition.LearningBlock % 2 == 0 ? pinV1 : pinV2; } currentPinGO.SetActive(true); shadowTr = transform.Find("shadow"); HandlePlayerClose(false); }
public void Initialise(int _pinIndex, JourneyPosition _journeyPosition) { pinIndex = _pinIndex; journeyPosition = _journeyPosition; name = "Pin_" + _journeyPosition; // Road sign with LB roadSignGO.SetActive(journeyPosition.PlaySession == 1); roadSignTextUI.SetText(journeyPosition.ToDisplayedString(false)); // Choosing the correct PIN based on the journey position pinV1.gameObject.SetActive(false); pinV2.gameObject.SetActive(false); pinAssessment.gameObject.SetActive(false); if (journeyPosition.IsAssessment()) { currentPinMesh = pinAssessment; } else { if (journeyPosition.LearningBlock % 2 == 0) { currentPinMesh = pinV1; } else { currentPinMesh = pinV2; } } currentPinMesh.gameObject.SetActive(true); shadowTr = transform.Find("shadow"); HandlePlayerClose(false); }