private void Update()
    {
        // Update will be suspended if the app is suspended or if the device is not tracking
        if (viewLoaderAnchor != null && !viewLoaderAnchorActivelyTracking)
        {
            timeToReplaceViewLoader -= Time.deltaTime;

            if (timeToReplaceViewLoader <= 0.0f)
            {
                placementControl.TogglePinnedState();
            }
        }
    }
示例#2
0
    public void ButtonAction()
    {
        // do not have two buttons active at the same time
        if (ToolManager.Instance != null && ToolManager.Instance.SelectedTool != null)
        {
            ToolManager.Instance.SelectedTool.Unselect();
        }

        if (ButtonPressed != null)
        {
            ButtonPressed(type);
        }

        switch (type)
        {
        case ButtonType.Back:
            if (cubeToMove == null || !cubeToMove.IsHolding)
            {
                ViewLoader.Instance.GoBack();
            }

            break;

        case ButtonType.Reset:
            if (cubeToMove == null || !cubeToMove.IsHolding)
            {
                if (TransitionManager.Instance)
                {
                    TransitionManager.Instance.ResetView();
                }
            }

            break;

        case ButtonType.MoveCube:
            ToolManager.Instance.LockTools();
            cubeToMove.TogglePinnedState();
            break;

            //case ButtonType.Show:
            //case ButtonType.Hide:
            //    ToolManager.Instance.ToggleTools();
            //    break;
        }
    }
示例#3
0
 private void ContentLoaded()
 {
     TransitionManager.Instance.ContentLoaded -= ContentLoaded;
     introEarth.TurnOnIntroEarth();
     placementControl.TogglePinnedState();
 }
    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;
    }