コード例 #1
0
    private void Update()
    {
        switch (currentState)
        {
        case IntroductionState.IntroductionStateAppDescription:
        case IntroductionState.IntroductionStateDevelopers:
        case IntroductionState.IntroductionStateCommunity:
            if (timeInState >= IntroSlateTime)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStateLogo:
            if (timeInState >= IntroLogoTime)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStateSlateFadeout:
        case IntroductionState.IntroductionStateLogoFadeout:
        case IntroductionState.IntroductionStateEarthHydrate:
            if (timeInState >= DialogExitTime)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStatePreloadSolarSystem:
            if (TransitionManager.Instance.InTransition == false)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStatePlaceEarth:
            if (introEarth == null)
            {
                GameObject currentContent = ViewLoader.Instance.GetCurrentContent();

                if (currentContent)
                {
                    introEarth = currentContent.GetComponent <IntroEarth>();

                    if (introEarth)
                    {
                        introEarth.SetIntroMode(true);
                        PlayOneShot(EarthPlacement);
                    }
                }
            }

            break;

        case IntroductionState.IntroductionStateEarthFadeout:
            if (timeInState > SecondsToFadeOutEarth)
            {
                VOManager.Instance.PlayClip(Earth);
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionEarth:
            if (timeInState > SecondsOnEarth)
            {
                VOManager.Instance.PlayClip(SolarSystem);
                TransitionManager.Instance.LoadPrevScene("SolarSystemView");
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionSolarSystem:
            if (timeInState > SecondsOnSolarSystem)
            {
                TransitionManager.Instance.IsIntro = false;
                TransitionManager.Instance.LoadPrevScene("GalaxyView");
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionGalaxy:
            if (timeInState > SecondsOnGalaxy)
            {
                AdvanceIntroduction();
            }

            break;
        }

        timeInState += Time.deltaTime;
    }
コード例 #2
0
    private void Update()
    {
        switch (currentState)
        {
        case IntroductionState.IntroductionStateAppDescription:
        case IntroductionState.IntroductionStateDevelopers:
        case IntroductionState.IntroductionStateCommunity:
            if (timeInState >= IntroSlateTime)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStateLogo:
            if (timeInState >= IntroLogoTime)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStateSlateFadeout:
        case IntroductionState.IntroductionStateLogoFadeout:
            if (timeInState >= DialogExitTime)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStatePreloadSolarSystem:
            if (TransitionManager.Instance.InTransition == false)
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStateEarthHydrate:
            if (SkipPlaceEarth || (timeInState >= DialogExitTime))
            {
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionStatePlaceEarth:
            if (introEarth == null)
            {
                GameObject currentContent = ViewLoader.Instance.GetCurrentContent();

                if (currentContent)
                {
                    introEarth = currentContent.GetComponent <IntroEarth>();

                    if (introEarth)
                    {
                        introEarth.SetIntroMode(true);
                        PlayOneShot(EarthPlacement);
                    }
                }
            }
            else
            {
                if (SkipPlaceEarth && TransitionManager.Instance.InTransition == false)
                {
                    placementControl.TogglePinnedState();
                }
            }

            break;

        case IntroductionState.IntroductionStateEarthFadeout:
            if (timeInState > SecondsToFadeOutEarth)
            {
                if (!SkipPlaceEarth)
                {
                    // If we placed the Earth, play the VO "Great!" to
                    // give feedback to the user that they did something
                    // important.
                    VOManager.Instance.PlayClip(EarthCentered);
                }
                VOManager.Instance.PlayClip(Earth);
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionEarth:
            if (timeInState > SecondsOnEarth)
            {
                VOManager.Instance.PlayClip(SolarSystem);
                TransitionManager.Instance.LoadPrevScene("SolarSystemView");
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionSolarSystem:
            if (timeInState > SecondsOnSolarSystem)
            {
                TransitionManager.Instance.IsIntro = false;
                TransitionManager.Instance.LoadPrevScene("GalaxyView");
                AdvanceIntroduction();
            }

            break;

        case IntroductionState.IntroductionGalaxy:
            if (timeInState > SecondsOnGalaxy)
            {
                AdvanceIntroduction();
            }

            break;
        }

        timeInState += Time.deltaTime;
    }