コード例 #1
0
 void TimeFlying()
 {
     // if (timeFlyingEvents[0] != storyTextScript.fadeCanvasScript.fadeDuration) {
     //  timeFlyingEvents[0] = storyTextScript.fadeCanvasScript.fadeDuration;
     // }
     if (boardTimer < boardEvents[boardEvents.Count - 1] + tapTime)
     {
         boardTimer += Time.deltaTime;
     }
     if (storyTextScript.fadeCanvasScript.shown && inputDetScript.Tapped)
     {
         //audioManHubMenuScript.ButtonSound(); //clicking sound
         boardBools[0] = true;
     }
     // SHOW TAP ICON
     if (boardTimer >= boardEvents[1] && !boardBools[1])
     {
         storyIconsScript.ShowNextButton();
         boardBools[1] = true;
     }
     // TAP EVENT
     if (boardTimer >= boardEvents[2] && !boardBools[2] && nextBtnPressed || boardTimer >= boardEvents[2] && !boardBools[2] && inputDetScript.Tapped)
     {
         storyIconsScript.HideNextButton();
         tapTime        = boardTimer;
         exitingBoard   = true;
         nextBtnPressed = false;
         boardBools[2]  = true;
         audioManHubMenuScript.ButtonSound();             //clicking sound
     }
     if (exitingBoard)
     {
         if (boardTimer >= boardEvents[3] + tapTime && !boardBools[3])
         {
             blackScreenFadeScript.FadeIn();
             boardBools[3] = true;
         }
         if (blackScreenFadeScript.shown && boardBools[3])
         {
             introStates = IntroStates.Gust;
             storyTimeMoScript.normalTime.SetActive(false);
             storyTextScript.TurnTextOff();
             boardTimer = 0f;
             boardEvents.Clear();
             boardEvents = gustEvents;
             boardBools.Clear();
             for (int i = 0; i < gustEvents.Count; i++)
             {
                 boardBools.Add(false);
             }
             exitingBoard = false;
             tapTime      = 99999f;
             // AUDIO - BOARD CHANGE TIME HOVER SOUND SHOULD STOP!
             audioIntroScript.STOP_introTimeHoverLoopSFX();
             audioIntroScript.STOP_introWindLoopSFX();
         }
     }
 }
コード例 #2
0
 // Level complete, load silver eggs, start crate animation.
 public void SilverEggsSetup()
 {
     canPlay = false;
     //Set the silver egg sprites to Hollow if the egg was found already.
     for (int i = 0; i < GlobalVariables.globVarScript.puzzSilEggsCount.Count; i++)
     {
         int eggNumber = GlobalVariables.globVarScript.puzzSilEggsCount[i];
         mySilverEggMan.allSilEggs[eggNumber].GetComponent <SpriteRenderer>().sprite = mySilverEggMan.hollowSilEgg;
         mySilverEggMan.allSilverEggsScripts[eggNumber].hollow = true;
         Debug.Log(mySilverEggMan.allSilEggs[eggNumber].name + "has been set to hollow, ooouuuhhhh. Like a ghost. A nice ghost. Yeeah.");
     }
     mySilverEggMan.lvlSilverEggs[curntLvl - 1].SetActive(true);         // CAN probably set it to true in the lvl finished seq or wtv
     if (mySilverEggMan.lvlSilverEggs[curntLvl - 1].transform.childCount > 0)
     {
         foreach (Transform silEgg in mySilverEggMan.lvlSilverEggs[curntLvl - 1].transform)
         {
             mySilverEggMan.activeSilverEggs.Add(silEgg.gameObject);
         }
     }
     mySilverEggMan.silverEggsActive = true;
     if (!mySelectButton.noFadeDelay)           // Turn off the initial fade delay for the three dots. Should only happen once.
     {
         mySelectButton.TurnFadeDelayOff();
         mySelectButton.noFadeDelay = true;
     }
     LvlStuffFadeOut();
     foreach (GameObject silEgg in mySilverEggMan.activeSilverEggs)
     {
         silEgg.GetComponent <SilverEggSequence>().StartSequence();
     }
     scrnDarkImgScript.FadeIn();
 }
コード例 #3
0
 void CheckUnlock()
 {
     locked = GlobalVariables.globVarScript.fallLocked;
     //Check if the season is already unlocked
     if (!locked && comingSoonTitle)
     {
         bannerTitle.SetActive(false);
         closedLock.gameObject.SetActive(false);
         backColorFadeScript.gameObject.SetActive(true);
         backColorFadeScript.FadeIn();
         // To be terminated once all the seasons are implemented.
         comingSoonTitle.SetActive(true);
         comingSoonTitle.GetComponent <FadeInOutImage>().FadeIn();
         comingSoonTitle.GetComponentInChildren <FadeInOutTMP>().FadeIn();
         myHubScript.EnableSeasonObjs();
     }
 }
コード例 #4
0
    // 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");
    }
コード例 #5
0
 public void CinematicButton()
 {
     if (comingSoonTit)
     {
         float delay = openLock.gameObject.GetComponent <FadeInOutImage>().fadeDuration;
         comingSoonTitle.SetActive(true);
         FadeInOutTMP   textFade = comingSoonTitle.GetComponentInChildren <FadeInOutTMP>();
         FadeInOutImage imgFade  = comingSoonTitle.GetComponent <FadeInOutImage>();
         textFade.FadeIn();
         imgFade.FadeIn();
     }
     else
     {
         foreach (FadeInOutImage fadeScript in playCinematicFadeScripts)
         {
             fadeScript.FadeIn();
         }
     }
 }
コード例 #6
0
    public void ShowRiddleText()
    {
        int random = Random.Range(0, riddleHints.Count);

        riddleHints[random].SetActive(true);
        riddleCurntActive = riddleHints[random];

        riddTextFadeScript.fadeDelayDur     = riddCGFadeScript.fadeDuration;
        plainGoldEggFadeScript.fadeDelayDur = riddCGFadeScript.fadeDuration;
        riddTextFadeScript.FadeIn();
        plainGoldEggFadeScript.FadeIn();

        riddTextOn = true;

        dontCloseMenu.SetActive(false);

        hintCGFadeScript.FadeOut();
        hintBtn.interactable = false;
        riddCGFadeScript.FadeOut();
        riddleBtn.interactable = false;
    }
コード例 #7
0
 void GoToMenu()
 {
     GlobalVariables.globVarScript.toHub = false;
     hubScript.inHub = false;
     if (!mainMenuScript.gameObject.activeSelf)
     {
         mainMenuScript.gameObject.SetActive(true);
         // Put in variables to make the main menu be faded out.
     }
     // - TO TURN OFF IMMEDIATELY - //
     foreach (GameObject levelButton in levelButtons)
     {
         levelButton.SetActive(false);
     }
     //backToMenuBtn.enabled = false;
     // - MAKE THE CLOUDS CLOSE - //
     foreach (MoveCloud cloud in cloudsToMove)
     {
         cloud.MoveIn();
     }
     // - FADE OUT BACKTOMENU BTN - //
     // backToMenuFadeScript.FadeOut();
     // backToMenuIconFadeScript.FadeOut();
     foreach (FadeInOutCanvasGroup hubCanvasGroupFadeScript in hubScript.hubCanvasGroupFadeScripts)
     {
         hubCanvasGroupFadeScript.FadeOut();
     }
     // Season Unlock
     foreach (SeasonLock seasonLockScript in seasonLockScripts)
     {
         seasonLockScript.BackToMenu();
     }
     // - FADE IN TITLE - //
     titleFade.FadeIn();
     // - FADE IN SOLID BACKGROUND - //
     solidBGFade.FadeIn();
     // - FADE IN ALL BUTTONS - //
     fadeBtnIn = true;
     mainMenuScript.ResetStory();
 }
コード例 #8
0
 void Update()
 {
     // -- Fade Menu Buttons In -- //
     if (fadeBtnIn)
     {
         btnWaitTimer += Time.deltaTime;
         if (btnWaitTimer >= btnFadeInWait)
         {
             playBtnFadeScript.FadeIn();
             rstBtnFadeScript.FadeIn();
             deleteSaveBtnCGFadeScript.FadeIn();
             fadeBtnIn = false;
             hubScript.ResetHubSeasons();
             foreach (SeasonGlows seasonGlowScript in seasonGlowScripts)
             {
                 seasonGlowScript.ResetGlowAlphas();
             }
             edgeFirefliesScript.StopFireflyFX();
             btnWaitTimer = 0f;
             //this.gameObject.SetActive(false);
             //backToMenuBtn.enabled = false;
         }
     }
 }
コード例 #9
0
    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
    }
コード例 #10
0
    void Update()
    {
        if (waitingToStartSeq && !ClickOnEggs.inASequence && clickOnEggsScript.eggMoving <= 0)
        {
            clickOnEggsScript.openEggPanel      = false;
            clickOnEggsScript.lockDropDownPanel = false;
            inLvlCompSeqSetup = true;
            // In a sequence.
            ClickOnEggs.inASequence = true;
            waitingToStartSeq       = false;
            clickOnEggsScript.menuStatesScript.menuStates = MenuStatesManager.MenuStates.TurnOff;
            //endLvlBtn.interactable = false;
            sceneTapEnabScript.canTapEggRidPanPuz = false;
            sceneTapEnabScript.canTapHelpBird     = false;
            sceneTapEnabScript.canTapPauseBtn     = false;
            sceneTapEnabScript.canTapLvlComp      = true;
        }

        if (inLvlCompSeqSetup)
        {
            timer += Time.deltaTime;
            if (timer > darkenScreen && !darkenScreenStarted)
            {
                coverFadeScript.FadeIn();
                lvlTapManScript.ZoomOutCameraReset();
                darkenScreenStarted = true;
            }
            if (timer >= birdIn && !birdInStarted)
            {
                lvlCompBirdScript.moveUp = true;
                birdInStarted            = true;
            }
            if (timer > showCongrats && !showCongratsStarted)
            {
                // AUDIO - CONGRATS TITLE STARTS APPEARING!
                audioLevelCompleteScript.congratsTxtSnd();

                congratsColorFadeScript.startFadeIn = true;
                splineWalkerScript.isPlaying        = true;
                splineWalkerFX.Play();
                showCongratsStarted = true;
            }
            if (timer > startTmpWave && !tmpWaveStarted)
            {
                congratsWaveScript.waveOn = true;
                tmpWaveStarted            = true;
            }
            // if (timer > showEggs && !showEggsStarted) {
            //  if (eggsFadeScripts.Length > 0) {
            //      foreach (FadeInOutSprite eggFadeScript in eggsFadeScripts)
            //      {
            //          eggFadeScript.FadeIn();
            //      }
            //  }
            //  showEggsStarted = true;
            // }
            if (timer > showTotalCounter && !showTotalCounterStarted)
            {
                // lineFadeScript.FadeIn();
                // totalCounterFadeScript.FadeIn();
                lvlCompBirdScript.waitForConTxtOut = true;
                showTotalCounterStarted            = true;
            }
            if (timer > spawnEggs && !spawnEggsStarted)
            {
                levelCompleteEggSpaScript.StartAllEggSpawn();
                spawnEggsStarted = true;
            }
            if (timer > showBag && !showBagStarted)
            {
                levelCompleteEggbagScript.MakeCurrentBagAppear();
                showBagStarted = true;
            }
            // if (timer > showBagGlow && !showBagGlowStarted) {
            //  // levelCompleteEggbagScript.StartCurrentBagGlow();
            //  // levelCompleteEggbagScript.bagAnim.SetTrigger("Rise");
            //  showBagGlowStarted = true;
            // }
            if (timer > endLevel && !levelEnded)
            {
                lvlCompBirdScript.waitForCountOut = true;
                tapToLeave = true;
                levelEnded = true;
            }

            if (tapToLeave && inputDetScript.Tapped)
            {
                endLvlBtn.interactable = false;
                EndLevel();
            }
        }
    }
コード例 #11
0
 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();
         }
     }
 }