void Update() { if (GlobalVariables.globVarScript.toHub) // Goes straight to hub { ToHub(true); GlobalVariables.globVarScript.toHub = false; // Debug.Log("How many times do I go to hubbabubbaland!"); } if (inputDetScript.Tapped && !skipFrame) { if (storyAppearing || storyFullyOn) { StorySkipContinue(); } } if (storyAppearing) { if (storyTMP.color.a >= 0.95f) { storyAppearing = false; storyFullyOn = true; } } if (storyFullyOn && moveClouds) { if (storyTMP.color.a <= 0.15f) { MoveClouds(); solidBGFade.FadeOut(); storyFullyOn = false; } } skipFrame = false; }
// Start moving the puzzle piece. public void UnlockPuzzle() { movePuzzPiece = true; clickOnEggsScript.eggMoving += 1; endPos = endPosObj.transform.position; pointerFadeScript.FadeOut(); anim.SetTrigger("PuzzPiecePop"); //splineWalkerScript.IsPlaying = true; //Play FX's through animation events //puzzPiece.transform.parent = puzzParentObj.transform.parent; darkScreenFadeScript.FadeIn(); sceneTapScript.canTapEggRidPanPuz = false; sceneTapScript.canTapHelpBird = false; sceneTapScript.canTapPauseBtn = false; levelTapScript.ZoomOutCameraReset(); audioSceneGenScript.puzzlePieceAnimation(); //Debug.Log("sound - Puzzle piece"); }
// Use this for initialization void Start() { activeClam = false; gameObject.transform.localScale = gameObject.transform.localScale * (bubbleSize); StartPosition = gameObject.transform.localPosition; currentTime = 0; mySprite = this.gameObject.GetComponent <SpriteRenderer>(); myFade = this.gameObject.GetComponent <FadeInOutSprite>(); mySprite.enabled = false; activeSprite = false; fadeInOutSprite = false; myFade.FadeOut(); }
// Update is called once per frame void Update() { if (activeClam && !activeSprite) { currentTime += Time.deltaTime; if (currentTime > lifeTimedelay) { myFade.ResetAlpha(0); mySprite.enabled = true; activeSprite = true; myFade.FadeIn(); //bubbles sounds .. audioBeachPuzzleScript = GameObject.Find("Audio").GetComponent <AudioSceneBeachPuzzle>(); audioBeachPuzzleScript.BubblePopSFX(); } } if (activeSprite) { currentTime += Time.deltaTime; if (currentTime < (lifeTime + lifeTimedelay) && currentTime > lifeTimedelay) { float yPos = gameObject.transform.localPosition.y + (Time.deltaTime * Speed); float xPos = curveTrail.Evaluate(currentTime + lifeTimedelay) * curveMultiplier; Vector3 newPos = new Vector3(xPos, yPos, gameObject.transform.localPosition.z); gameObject.transform.localPosition = newPos; } else { if (!fadeInOutSprite) { myFade.FadeOut(); fadeInOutSprite = true; } currentTime = 0; bubblePopFX.transform.position = this.transform.position; var bubMain = bubblePopFX.main; bubMain.startSize = bubbleSize + 0.2f; bubblePopFX.Play(); mySprite.enabled = false; gameObject.transform.localPosition = StartPosition; activeSprite = false; activeClam = false; } } }
void PlayBtn() { // - MAKE THE CLOUDS PART - // foreach (MoveCloud cloud in cloudsToMove) { cloud.moveOut = true; } // - FADE OUT TITLE - // titleFade.FadeOut(); // - FADE OUT SOLID BACKGROUND - // solidBGFade.FadeOut(); // - FADE OUT ALL MENU BUTTONS - // fadeBtnOut = true; }
void Update() { if (startEggMove) { spawnTimer += Time.deltaTime; if (spawnTimer > mySpawnDelay && !moveEgg) { myFadeScript.FadeIn(); eggTypeAnim.SetTrigger("Scale"); moveEgg = true; //endTrans = levelCompleteEggbagScript.eggBags[levelCompleteEggbagScript.levelsCompleted].gameObject.transform; } if (moveEgg) { if (!trailFX.isPlaying) { trailFX.Play(true); } lerp += Time.deltaTime / duration; this.transform.position = Vector3.Lerp(startPos, endTrans.position, animCurve.Evaluate(lerp)); if (lerp >= 1) { eggBagAnim.SetTrigger("Scale"); levelCompEggCounterScript.eggAmnt++; if (levelCompEggCounterScript.eggAmnt == 1) { levelCompleteEggbagScript.MakeNewBagFadeIn(); } //AUDIO SOUND EGGS COUNTER audioLevelCompleteScript.eggsCounterSnd(); myFadeScript.FadeOut(); arrivalFX.Play(true); trailFX.Stop(true); moveEgg = false; startEggMove = false; // if (amIGolden) { // levelCompleteEggbagScript.MakeNewBagAppear(); // } } } } }
// The OneEgg flies out from Time to the middle of the hub. (TheQuest #011) void FlyOutOfTime() { lerpValue += Time.deltaTime / flyDur; float speedLerpValue = speedCurve.Evaluate(lerpValue); newX = Mathf.Lerp(iniX, maxX, flyAnimCurveX.Evaluate(speedLerpValue)); newY = Mathf.Lerp(iniY, maxY, flyAnimCurveY.Evaluate(speedLerpValue)); theOneEgg.transform.position = new Vector3(newX, newY, theOneEgg.transform.position.z); //theOneEgg.transform.localScale = Vector3.Lerp(startScale, endScale, flyAnimCurveY.Evaluate(speedLerpValue)); if (speedLerpValue >= 1f) { speedLerpValue = 0f; flyOutOfTime = false; behindTheOneEggFadeScript.FadeOut(); eggToMidTrailFX.Stop(); eggSealAnim.SetTrigger("EggSeal"); } if (speedLerpValue >= 0.5f && oneEggShadowFadeScript.shown) { oneEggShadowFadeScript.FadeOut(); } }
void PlayBtn() { // - MAKE THE CLOUDS PART - // foreach (MoveCloud cloud in cloudsToMove) { cloud.moveOut = true; } // - FADE OUT TITLE - // titleFade.FadeOut(); // - FADE OUT SOLID BACKGROUND - // solidBGFade.FadeOut(); // - FADE OUT ALL MENU BUTTONS - // fadeBtnOut = true; // - Button Sound - // (L) PlayButtonSnd(); // - Music Transition towards Hub Music - // (L) StopMusicMenu(); }
void Update() { if (startEggMove) { spawnTimer += Time.deltaTime; this.transform.Rotate(Vector3.forward * spinDir * (spinSpeed * Time.deltaTime)); if (spawnTimer > mySpawnDelay && !showEgg) { // if (amIFirst) { // rotateFXScript.RotatePlayFX(); // } // AUDIO - EGG APPEARS! audioLevelCompleteScript.circleEggsSoloSnd(); myFadeScript.FadeIn(); myGlowFadeScript.FadeIn(); spawnFX.Play(); showEgg = true; endTrans = levelCompleteEggbagScript.curEggbagFadeScript.gameObject.transform; } if (showEgg) { // Glow from current alpha value to 1f (maximum). if (spawnTimer >= glowMaxDelay && !glowMax) { myGlowFadeScript.maxAlpha = 1f; myGlowFadeScript.FadeIn(myGlowFadeScript.sprite.color.a); // if (amIFirst) { // rotateFXScript.RotatePlayFX(); // } glowMax = true; // AUDIO - EGG APPEARS! audioLevelCompleteScript.circleEggsSoloGoldSnd(); } // Scene egg fades out. if (spawnTimer >= whiteDelay && !white) { myFadeScript.FadeOut(); if (amIFirst) { rotateFXScript.RotatePlayFX(); } white = true; // AUDIO - WHITE EGGS APPEARS! audioLevelCompleteScript.circleEggsGlowSnd(); //nicer sound but doesnt help the gitching?? //audioLevelCompleteScript.circleEggsSoloSilverSnd(); } // Plain egg fades in. if (spawnTimer >= plainDelay && !plain) { myGlowFadeScript.FadeOut(0.25f); plainEggFadeScript.FadeIn(); // if (amIFirst) { // rotateFXScript.RotatePlayFX(); // } // myFadeScript.FadeOut(); plain = true; // AUDIO - PLAIN EGGS APPEARS! audioLevelCompleteScript.circleEggsSoloPlainSnd(); } // Shake anim. if (spawnTimer >= shakeDelay && !shakeStarted) { // eggAnim.SetTrigger("Shake"); // myFadeScript.FadeOut(); // Hardcoded because 1f is always the max. // myGlowFadeScript.maxAlpha = 1f; // myGlowFadeScript.FadeIn(myGlowFadeScript.sprite.color.a); shakeStarted = true; // moveEgg gets set to true at the end of the "Shake" animation. } // Move egg. if (spawnTimer >= moveDelay && !moveEgg) { if (amIFirst) { rotateFXScript.RotatePlayFX(lvlCompEggSpawnScript.allEggToBagDuration); } moveEgg = true; //AUDIO EGGS IN BAG MOUVEMENT? if (!audioMoveToBag) { audioLevelCompleteScript.eggsMoveInBagSnd(); audioMoveToBag = true; } } if (moveEgg) { if (!trailFX.isPlaying) { trailFX.Play(true); } lerp += Time.deltaTime / moveDuration; this.transform.position = Vector3.Lerp(startPos, endTrans.position, animCurve.Evaluate(lerp)); // if (lerp >= 0.5f && !glowOut) { // myGlowFadeScript.FadeOut(); // glowOut = true; // } if (lerp >= 1) { levelCompEggCounterScript.eggAmnt++; // AUDIO - EGG REACHES BAG! audioLevelCompleteScript.eggsCounterSnd(); //myFadeScript.FadeOut(); plainEggFadeScript.FadeOut(); myGlowFadeScript.FadeOut(); arrivalFX.Play(true); trailFX.Stop(true); showEgg = false; startEggMove = false; spawnTimer = 0f; levelCompleteEggbagScript.bagAnim.SetTrigger("Scale"); //levelCompleteBagGlowScript.CalculateNewAlpha(myGlowValue); if (amIFirst) { levelCompleteEggbagScript.StartCurrentBagGlow(); //levelCompleteEggbagScript.iniYPos = levelCompleteEggbagScript.curEggBagTrans.position.y; //levelCompleteEggbagScript.bagRise = true; //levelCompleteEggbagScript.bagAnim.SetTrigger("Rise"); FXSpeedScript.myPartSys.Play(); } if (amIGolden) { bagExplosionWait = true; FXSpeedScript.IncreaseSimulationSpeed(); // //AUDIO particules in bag audioLevelCompleteScript.particulesInBagSnd(); } } } } } if (bagExplosionWait) { bagExplodeDelay -= Time.deltaTime; if (bagExplodeDelay <= 0f) { levelCompleteEggbagScript.bagAnim.SetTrigger("Explode"); bagExplosionWait = false; } } }
void Update() { if (Tapped) { if (closed) { //clam sound audioBeachPuzzleScript.playOceanSound(clamSound); myCollider.enabled = false; open = true; closed = false; myOpenClam.fadeDelay = false; myOpenClam.FadeIn(); myClosedClam.fadeDelay = true; myClosedClam.FadeOut(); foreach (BeachBubbles bubbles in myBubbles) { bubbles.ResetBubble(); bubbles.activeClam = true; } Tapped = false; } } if (failed) { if (closed) { myCollider.enabled = true; myClosedClam.fadeDelay = false; myClosedClam.FadeIn(); myOpenClam.fadeDelay = true; myOpenClam.FadeOut(); failed = false; } if (open /* && put delay for sound*/ || forceClose) { open = false; closed = true; forceClose = false; //failed match sound .. should put a delay or something //audioBeachPuzzleScript.failSFX(); } } if (open && myMatch.matched) { timer += Time.deltaTime; if (timer >= timeDelay && open) { myOpenClam.FadeOut(); matched = true; open = false; //"matched" and "dissolve" sound audioBeachPuzzleScript.BubblesSFX(); audioBeachPuzzleScript.addToMusicList(clamSound); } } if (setFadeDurToPlay) { showClamTimer += Time.deltaTime; if (showClamTimer >= clamUpDelay && clamWaiting) { clamAnim.SetTrigger("ShowClam"); myClosedClam.FadeIn(); clamWaiting = false; //sound clam pop audioBeachPuzzleScript.clamPopOutSFX(); } if (showClamTimer >= (clamUpDelay + iniFadeInDur) && setFadeDurToPlay) { myClosedClam.fadeDuration = playFadeInDur; showClamTimer = 0f; setFadeDurToPlay = false; } } }
public void HideNextIcon() { nextIconFadeScript.FadeOut(); }
public void ResetNormalTime() { normalTime.transform.position = iniNormPos; normalTime.transform.localScale = iniNormScale; normTimeFadeScript.FadeOut(); }
public void FadeOutGlidingTime() { glidingTimeFadeScript.FadeOut(); }