/// <summary> /// Updates the pet's form, using this class's current place in the pet /// form tree. /// </summary> public void advancePetForm() { Instantiate(EvoParticles, transform.position + new Vector3(0.0f, 0.0f, -1f), Quaternion.Euler(90f, 0f, 0f)); if (currentPetFormNode.nextForms.Count == 0) { return; } // check which form the pet is in the neediness bounds for float current_neediness = petStatus.getNeediness(); foreach (PetFormBranch branch in currentPetFormNode.nextForms) { float minBound = branch.minimumNeediness; float maxBound = branch.maximumNeediness; if ((minBound < 0 || current_neediness >= minBound) && (maxBound < 0 || current_neediness < maxBound)) { currentPetFormIndex = branch.nextFormTreeId; currentPetFormNode = petFormDataTree[currentPetFormIndex]; break; } } if (musicHandler != null) { musicHandler.updateFormMusicData(currentPetFormIndex); } loadPetFormDataFile(currentPetFormNode.petFormDataFile); }
// Update is called once per frame void Update() { if (unlockIndex < unlockValues.Count) { float nextUnlockValue = unlockValues[unlockIndex]; if (petStatus.getNeediness() >= nextUnlockValue) { InteractionData newInteraction = interactionUnlockData[nextUnlockValue]; interactionManager.startInteractionSystem(newInteraction); unlockIndex += 1; } } }