public void MoveBirdUpDown() { curHelpBirdPos = helpBirdTrans.position; if (myHint) { myHint.resetHint = true; } if (moveDown || isDown) // 1 is not necessary since 1 is always the lerp's max value, just there to visualize the rule of three. { if (!isDown) { newDuration = duration * lerpValue / 1; } else { newDuration = duration; } lerpValue = 0; moveDown = false; isDown = false; moveUp = true; allowClick = true; //sceneTapScript.canTapEggRidPanPuz = false; if (lvlTapManScript) { lvlTapManScript.ZoomOutCameraReset(); } if (introDone) { closeMenuOnClick.SetActive(true); } if (sceneTapScript) { sceneTapScript.TapLevelStuffFalse(); } audioHelperBirdScript.birdHelpSound(); return; } if (moveUp || isUp) { if (!isUp) { newDuration = duration * lerpValue / 1; } else { newDuration = duration; } lerpValue = 0; moveUp = false; isUp = false; moveDown = true; txtBubFadedIn = false; allowClick = false; } }
void Update() { if (moveUp) { lerp += Time.deltaTime / moveDur; helperBird.transform.position = Vector3.Lerp(hiddenTrans.position, shownTrans.position, moveCurve.Evaluate(lerp)); if (!audioBirdPop) { //AUDIO SWOOSH BIRD audioHelperBirdScript.youDidItSnd(); audioBirdPop = true; } if (lerp >= 1f) { helperBird.transform.position = shownTrans.position; lerp = 0f; moveUp = false; waitForBubIn = true; textBubFadeScript.FadeIn(); textBubPointerFadeScript.FadeIn(); AdjustBubSize(bubSizeA); } } if (waitForBubIn && textBubFadeScript.shown) { congratsTextAnim.SetTrigger("PopIn"); congratsTextFadeScript.FadeIn(); waitForBubIn = false; //AUDIO BIRD HELP SOUND audioHelperBirdScript.birdHelpSound(); } if (waitForConTxtOut) { if (congratsTextFadeScript.shown) { congratsTextFadeScript.FadeOut(); } if (congratsTextFadeScript.hidden && counterCGFadeScript.hidden) { AdjustBubSize(bubSizeB); } if (congratsTextFadeScript.hidden && counterCGFadeScript.hidden && curBubSize == bubSizeB) { counterCGFadeScript.FadeIn(); waitForConTxtOut = false; //AUDIO BIRD HELP SOUND audioHelperBirdScript.birdHelpSound(); } } if (waitForCountOut) { if (counterCGFadeScript.shown) { counterCGFadeScript.FadeOut(); } if (counterCGFadeScript.hidden && backBtnCGFadeScript.hidden) { AdjustBubSize(bubSizeC); } if (counterCGFadeScript.hidden && backBtnCGFadeScript.hidden && curBubSize == bubSizeC) { backBtnCGFadeScript.FadeIn(); waitForConTxtOut = false; //AUDIO BIRD HELP SOUND audioHelperBirdScript.birdHelpSound(); } } if (adjustingBubSize) { bubLerp += Time.deltaTime / bubAdjustDur; curBubSize = Mathf.Lerp(prevBubSize, newBubSize, bubLerp); textBubSpriteRend.size = new Vector2(curBubSize, textBubSpriteRend.size.y); if (bubLerp >= 1f) { bubLerp = 0f; curBubSize = newBubSize; adjustingBubSize = false; } } }
void Update() { // Set the tutorial as "open", used to see if the player can play the puzzle or not. if (slideInHelpScript.moveUp && !tutOpen) { tutOpen = true; } // Set the tutorial as "closed", used to allow the player to interact with the puzzle. if (slideInHelpScript.moveDown && slideInHelpScript.lerpValue > 0.5f && tutOpen) { tutOpen = false; mainPuzzScript.canPlay = true; } // If the tutorial is "open" make sure the player cannot interact with the puzzle. if (tutOpen) { mainPuzzScript.canPlay = false; } // If the bird is moving up, fade in the darkened screen. if (slideInHelpScript.moveUp && !darkenScreen) { darkScreenFadeScript.FadeIn(); // mainPuzzScript.canPlay = false; darkenScreen = true; } // If the bird is fully up, fade in the first tutorial icons. if (slideInHelpScript.isUp && !showTut) { tutFadeScripts[0].FadeIn(); mainPuzzScript.canPlay = false; showTut = true; } // If the bird goes down fade out the last tutorial icons. if ((slideInHelpScript.moveDown || slideInHelpScript.isDown) && showTut) { currentTutFadeScript.FadeOut(); darkScreenFadeScript.FadeOut(); showTut = false; darkenScreen = false; } // To go to the next tutorial icons or close the tutorial. if (inputDetScript.Tapped) { // If there is more then one set of tutorial icons. if (currentTutFadeScript != lastTutFadeScript && currentTutFadeScript.shown) { currentTutFadeScript.FadeOut(); currentTutInList++; currentTutFadeScript = tutFadeScripts[currentTutInList]; currentTutFadeScript.FadeIn(); audioHelperBirdScript.birdHelpSound(); } else if (lastTutFadeScript.shown) { slideInHelpScript.MoveBirdUpDown(); mainPuzzScript.canPlay = true; levelSelectScript.InteractableThreeDots(mainPuzzScript.maxLvl, mainPuzzScript.curntLvl); sceneTapScript.canTapPauseBtn = true; SaveIntroDone(); currentTutFadeScript.FadeOut(); currentTutFadeScript = tutFadeScripts[0]; currentTutInList = 0; audioHelperBirdScript.birdHelpSound(); } } }
//Bird SFX public void unfrozenBirdSnd() { unfrozenBirdSound = FMODUnity.RuntimeManager.CreateInstance(unfrozenBirdEvent); unfrozenBirdSound.start(); audioHelperBirdScript.birdHelpSound(); }