Пример #1
0
    void Start()
    {
        UIFlash.Show();

        // Unload Al Scenes except BaseScene  (just for debug in unity)
        for (int i = 0; i < SceneManager.sceneCount; i++)
        {
            string sceneName = SceneManager.GetSceneAt(i).name;
            if (sceneName != "BaseScene")
            {
                SceneManager.UnloadScene(sceneName);
            }
        }

        StartCoroutine(PresentationSequence());
    }
Пример #2
0
    /**
     * Invokes a specified cue action.
     */
    private void InvokeCueAction(ScenarioCueAction action)
    {
        Debug.Log("Invoking action " + action.ToString());

        switch (action)
        {
        // Ends the tutorial and goes to the launcher library.
        case ScenarioCueAction.GotoLibrary:
            if (!laserGiven)
            {
                GiveLaser();
            }
            Instantiate(launcherRigPrefab);

            subtitlesObject.transform.localPosition    = new Vector3(8.3f, 9.4f, -14);
            subtitlesObject.transform.localEulerAngles = new Vector3(18, 0, 0);
            break;

        // Shows arcade logo
        case ScenarioCueAction.ShowLogo:
            FadeInFadeOut logoFader = GameObject.Find("ArcadeLogo").GetComponent <FadeInFadeOut>();
            logoFader.Show();
            break;

        // Hides the arcade logo
        case ScenarioCueAction.HideLogo:
            FadeInFadeOut logoFaderB = GameObject.Find("ArcadeLogo").GetComponent <FadeInFadeOut>();
            logoFaderB.Hide();
            break;

        // Shows skip text
        case ScenarioCueAction.ShowSkipTxt:
            FadeInFadeOut stFader = GameObject.Find("SkippableText").GetComponent <FadeInFadeOut>();
            stFader.Show();
            break;

        // Hides the skip text
        case ScenarioCueAction.HideSkipTxt:
            FadeInFadeOut stFaderB = GameObject.Find("SkippableText").GetComponent <FadeInFadeOut>();
            stFaderB.Hide();
            break;

        // Gives a laser pointer to the user.
        case ScenarioCueAction.GiveLaser:
            GiveLaser();

            targetInstance = Instantiate <GameObject>(targetPrefab);
            targetInstance.transform.parent = rig.transform;
            break;

        case ScenarioCueAction.HighlightMenu:
            highlightButtonOnBothControllers(EVRButtonId.k_EButton_ApplicationMenu, "Menu");
            break;

        case ScenarioCueAction.HighlightSide:
            Destroy(targetInstance, 3);
            highlightButtonOnBothControllers(EVRButtonId.k_EButton_Grip, "Boční tlačítko");
            break;

        case ScenarioCueAction.HighlightSystem:
            highlightButtonOnBothControllers(EVRButtonId.k_EButton_System, "Systém");
            break;

        case ScenarioCueAction.HighlightTouchpad:
            highlightButtonOnBothControllers(EVRButtonId.k_EButton_SteamVR_Touchpad, "Dotyková plocha");
            break;

        case ScenarioCueAction.HighlightTrigger:
            highlightButtonOnBothControllers(EVRButtonId.k_EButton_SteamVR_Trigger, "Spoušť");
            break;

        case ScenarioCueAction.Skip:
            FadeInFadeOut logoFaderC = GameObject.Find("ArcadeLogo").GetComponent <FadeInFadeOut>();
            logoFaderC.Hide();
            FadeInFadeOut stFaderC = GameObject.Find("SkippableText").GetComponent <FadeInFadeOut>();
            stFaderC.Hide();
            ExitTutorial();
            break;

        case ScenarioCueAction.WaitForUserRaise:
            pauseUntil = areControllersRaised;
            break;

        case ScenarioCueAction.WaitForUserTargetHit:
            pauseUntil = isTargetHit;
            break;

        case ScenarioCueAction.WaitForSide:
            pauseUntil = isSidePressed;
            break;

        case ScenarioCueAction.WaitForUserColor:
            pauseUntil = isColorSelected;
            break;
        }
    }