void PlayBtn() { // - MAKE THE CLOUDS PART - // foreach (MoveCloud cloud in cloudsToMove) { cloud.MoveOut(); } // - FADE OUT TITLE - // titleFade.FadeOut(); // - FADE OUT SOLID BACKGROUND - // solidBGFade.FadeOut(); // - FADE OUT MENU BUTTONS - // playBtnFadeScript.FadeOut(); resetBtnFadeScript.FadeOut(); deleteSaveBtnCGFadeScript.FadeOut(); // storyBtn.gameObject.SetActive(false); // Starts countdown timer to doing Village stuff hubScript.startHubActive = true; foreach (LevelTitleVillage levelTitleScript in levelTitleScripts) { levelTitleScript.CloseTitle(); } foreach (LevelFireflies levelFireflies in levelFirefliesScripts) { levelFireflies.StopLevelFireflies(); } foreach (CustomButtonClick customButtonScript in customButtonScripts) { customButtonScript.levelSelected = false; } }
void Update() { // Wait until no other sequences are playing to start the Puzzle Unlock sequence. if (waitToStartSeq && !ClickOnEggs.inASequence) { // In a sequence. ClickOnEggs.inASequence = true; waitToStartSeq = false; UnlockPuzzle(); //Debug.Log(ClickOnEggs.inASequence); } if (movePuzzPiece) { // lerpValue += Time.deltaTime / moveDuration; // curveValue = animCurve.Evaluate(lerpValue); // puzzPiece.transform.position = Vector3.Lerp(iniPos, endPos, curveValue); curPos = puzzPiece.transform.position; if (Vector2.Distance(curPos, endPos) <= 0.01f) { puzzPiece.transform.position = endPos; movePuzzPiece = false; PuzzPieceFXsScript.PieceShimFX(); PuzzPieceFXsScript.PieceRaysFX(); puzzFireworkFX.Play(true); ActivatePuzzle(); darkScreenFadeScript.FadeOut(); clickOnEggsScript.eggMoving -= 1; sceneTapScript.canTapEggRidPanPuz = true; sceneTapScript.canTapHelpBird = true; sceneTapScript.canTapPauseBtn = true; // Sequence finished. ClickOnEggs.inASequence = false; } } }
// Checks if the player tapped enough silver eggs to move on, change the current level. public virtual void SilverEggsCheck() { if (mySilverEggMan.activeSilverEggs.Count > 0) { if (mySilverEggMan.amntSilEggsTapped == mySilverEggMan.activeSilverEggs.Count) { mySilverEggMan.activeSilverEggs.Clear(); mySilverEggMan.silverEggsActive = false; mySilverEggMan.amntSilEggsTapped = 0; scrnDarkImgScript.FadeOut(); curntLvl++; if (curntLvl > maxLvl) { maxLvl = curntLvl; SaveMaxLvl(); mySelectButton.EnabledThreeDots(maxLvl); } voidDelegate = NextLevelSetup; if (!waitMethod) { waitMethod = true; } else { Debug.LogError("waitMethod IS ALREADY IN PROGRESS, DONT DO THAT!!"); } waitTimer = waitTime; } } }
void Update() { if (slideInScript.isUp && slideInScript.introDone && !riddBtnOn) { if (clickOnEggsScript.goldenEggFound == 1) { riddleBtn.interactable = false; riddCGFadeScript.maxAlpha = 0.5f; } else { riddleBtn.interactable = true; } riddCGFadeScript.FadeIn(); riddBtnOn = true; dontCloseMenu.SetActive(true); } if (!slideInScript.isUp && riddBtnOn) { riddBtnOn = false; if (!riddCGFadeScript.hidden && !riddCGFadeScript.fadingOut) { riddCGFadeScript.FadeOut(); riddleBtn.interactable = false; } } if (slideInScript.moveDown && riddTextOn) { riddTextFadeScript.fadeDelayDur = 0f; plainGoldEggFadeScript.fadeDelayDur = 0f; riddTextFadeScript.FadeOut(); plainGoldEggFadeScript.FadeOut(); } }
void Update() { // Keep track of the current active scene. if (currentScene != SceneManager.GetActiveScene().name) // This causes GC alloc. { currentScene = SceneManager.GetActiveScene().name; } titleCardTxt.color = new Color(titleCardTxt.color.r, titleCardTxt.color.g, titleCardTxt.color.b, titleCardImg.color.a); #region Title Card & Black Background scene transition. if (titCardSceneTrans) { if (newAlpha == 0) { myOperation = SceneManager.LoadSceneAsync(sceneToLoad); myOperation.allowSceneActivation = false; //QualitySettings.asyncUploadTimeSlice = 2; } //if (!setupNewCard) { ChoseTitleCard(); } if (fadeImage != blckFadeImage) { fadeImage = blckFadeImage; } // -- FADE OUT CURRENT SCENE -- // if (fadeSceneOut) { if (fadeSceneIn) { fadeSceneIn = false; } // Set the transition image to raycast target to block the player from tapping on any buttons while it is transitioning. if (!fadeImage.raycastTarget) { fadeImage.raycastTarget = true; } curveTime += Time.deltaTime / fadeTime; newAlpha = animCurve.Evaluate(curveTime); fadeImage.color = new Color(fadeImage.color.r, fadeImage.color.g, fadeImage.color.b, newAlpha); if (newAlpha >= startTitleCardFade) { if (titleCardTxt.text != sceneToLoad) { titleCardTxt.text = sceneToLoad; } // start playing music for the scene here if (!titleCardObj.activeInHierarchy) { titleCardObj.SetActive(true); titleCardFadeScript.FadeIn(); } if (titleCardImg.color.a >= 1 && titleCardTimer < minTitleCardShowTime) { titleCardTimer += Time.deltaTime; } } // If transition and titlecard faded in completely. if (newAlpha >= 1 && titleCardImg.color.a >= 1 && currentScene != sceneToLoad) { curveTime = 1; newAlpha = 1; myOperation.allowSceneActivation = true; } // If scene has been loaded and title card has been on long enough. if (/*currentScene == sceneToLoad*/ myOperation.isDone && titleCardTimer >= minTitleCardShowTime) { inTransition = false; fadeSceneIn = true; fadeSceneOut = false; //SceneManager.LoadScene(sceneToLoad); titleCardTimer = 0f; curveTime = 0; } } // -- FADE IN NEW SCENE -- // if (fadeSceneIn) { titleCardFadeScript.FadeOut(); if (titleCardImg.color.a <= startBackgroundFade) { curveTime += Time.deltaTime / fadeTime; newAlpha = 1 - animCurve.Evaluate(curveTime); fadeImage.color = new Color(fadeImage.color.r, fadeImage.color.g, fadeImage.color.b, newAlpha); } if (newAlpha <= 0.2) { if (fadeImage.raycastTarget) { fadeImage.raycastTarget = false; } } if (newAlpha <= 0) { //if (fadeImage.raycastTarget) { fadeImage.raycastTarget = false; } curveTime = 0; newAlpha = 0; fadeSceneIn = false; titCardSceneTrans = false; //setupNewCard = false; } } } #endregion #region White Background scene transition. if (whtSceneTrans) { if (fadeImage != whtFadeImage) { fadeImage = whtFadeImage; } // -- FADE OUT CURRENT SCENE -- // if (fadeSceneOut) { if (fadeSceneIn) { fadeSceneIn = false; } // Set the transition image to raycast target to block the player from tapping on any buttons while it is transitioning. if (!fadeImage.raycastTarget) { fadeImage.raycastTarget = true; } curveTime += Time.deltaTime / fadeTime; newAlpha = animCurve.Evaluate(curveTime); fadeImage.color = new Color(fadeImage.color.r, fadeImage.color.g, fadeImage.color.b, newAlpha); // If transition and titlecard faded in completely. if (newAlpha >= 1 && currentScene != sceneToLoad) { curveTime = 1; newAlpha = 1; SceneManager.LoadScene(sceneToLoad); } if (titleCardTimer < minTitleCardShowTime) { titleCardTimer += Time.deltaTime; } // If scene has been loaded and title card has been on long enough. if (currentScene == sceneToLoad && titleCardTimer >= minTitleCardShowTime) { fadeSceneIn = true; fadeSceneOut = false; titleCardTimer = 0f; curveTime = 0; inTransition = false; } } // -- FADE IN NEW SCENE -- // if (fadeSceneIn) { curveTime += Time.deltaTime / fadeTime; newAlpha = 1 - animCurve.Evaluate(curveTime); fadeImage.color = new Color(fadeImage.color.r, fadeImage.color.g, fadeImage.color.b, newAlpha); if (newAlpha <= 0.2) { if (fadeImage.raycastTarget) { fadeImage.raycastTarget = false; } } if (newAlpha <= 0) { //if (fadeImage.raycastTarget) { fadeImage.raycastTarget = false; } curveTime = 0; newAlpha = 0; fadeSceneIn = false; whtSceneTrans = false; } } } #endregion }
void Gust() { if (blackScreenFadeScript.shown && !boardBools[0]) { blackScreenFadeScript.FadeOut(); storyScrollBGScript.SetUpClouds(storyScrollBGScript.blurredSidewaysBGs, storyScrollBGScript.blurSideScrollSpeed); storySingleCloudScript.PlayClouds(storySingleCloudScript.xPartSys, storySingleCloudScript.gustSpeedMult, true); } // Distorted sky instead of normal. if (boardTimer < boardEvents[boardEvents.Count - 1] + tapTime) { boardTimer += Time.deltaTime; } if (boardTimer >= boardEvents[0] && !boardBools[0]) { storyTextScript.SetupText(storyBoardTextNum); storyBoardTextNum++; boardBools[0] = true; // AUDIO - GUST MOVES IN! audioIntroScript.introGustHoverSFX(); audioIntroScript.introWindLoopSFX(); } if (boardTimer >= boardEvents[1] && !boardBools[1]) { storyGustScript.SetupXMove(storyGustScript.startTrans.position.x, storyGustScript.midTrans.position.x, storyGustScript.moveInDur, storyGustScript.moveInXCurve); storyGustScript.yHover = true; boardBools[1] = true; } // SHOW TAP ICON if (boardTimer >= boardEvents[2] && !boardBools[2]) { storyIconsScript.ShowNextButton(); boardBools[2] = true; } // TAP EVENT if (boardTimer >= boardEvents[3] && !boardBools[3] && nextBtnPressed || boardTimer >= boardEvents[3] && !boardBools[3] && inputDetScript.Tapped) { storyIconsScript.HideNextButton(); tapTime = boardTimer; exitingBoard = true; nextBtnPressed = false; boardBools[3] = true; audioManHubMenuScript.ButtonSound(); //clicking sound } if (exitingBoard) { if (boardTimer >= (boardEvents[4] + tapTime) && !boardBools[4]) { storyGustScript.SetupXMove(storyGustScript.midTrans.position.x, storyGustScript.endTrans.position.x, storyGustScript.moveInDur, storyGustScript.moveOutXCurve); boardBools[4] = true; //AUDIo stop wind stop from Gust HOver loop audioIntroScript.STOP_introGustHoverSFX(); // AUDIO - GUST MOVES OUT! audioIntroScript.introGustSFX(); //stop loop play a one shot Gust sound } if (boardTimer >= (boardEvents[5] + tapTime) && !boardBools[5]) { blackScreenFadeScript.FadeIn(); boardBools[5] = true; } if (boardBools[5] && blackScreenFadeScript.shown) { introStates = IntroStates.TheAccident; boardTimer = 0f; boardEvents.Clear(); boardEvents = theAccidentEvents; boardBools.Clear(); for (int i = 0; i < theAccidentEvents.Count; i++) { boardBools.Add(false); } tapTime = 999999f; exitingBoard = false; audioIntroScript.STOP_introWindLoopSFX(); } } }
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(); } } }