コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        var fader = ScreenFader.Instance;

        fader.FadeTo(Color.black, 10f);
        ExperienceApp.End();
    }
コード例 #2
0
        public static IVRDevice CreateDevice(ExperienceApp experienceApp = null)
        {
            // TODO Add an environment SDK Configuration.
#if UNITY_XR
            return(CreateDevice(ESDKType.UnityXR));
#else
            return(CreateDevice(Application.platform == RuntimePlatform.Android ? ESDKType.OVR : ESDKType.OpenVR));
#endif
        }
コード例 #3
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Is running");
        var fader = ScreenFader.Instance;

        fader.FadeTo(Color.black, 10f);
        ExperienceApp.End();
        Debug.Log("Is running");
    }
コード例 #4
0
    private IEnumerator EndOfGame()
    {
        ScreenFader.Instance.FadeTo(Color.black, duration: 1);
        yield return(ScreenFader.Instance.WaitUntilFadeComplete());

        Debug.Log("End");
        ExperienceApp.End();
        Application.Quit();
    }
コード例 #5
0
    private IEnumerator Outro()
    {
        ScreenFader.Instance.FadeToBlack(13);
        yield return(ScreenFader.Instance.WaitUntilFadeComplete());

        yield return(new WaitForSeconds(2));

        ExperienceApp.End();
    }
コード例 #6
0
        private static void ClearAppData(ExperienceApp app)
        {
            if (app == null)
            {
                return;
            }

            var so = new SerializedObject(app);

            so.FindProperty("m_AppData").objectReferenceValue     = null;
            so.FindProperty("m_AssetLookup").objectReferenceValue = null;
            so.FindProperty("m_RootGameObjects").ClearArray();
            so.FindProperty("m_RootGameObjects").arraySize = 0;
            so.ApplyModifiedProperties();
        }
コード例 #7
0
        public IEnumerator Unload(ExperienceApp app)
        {
            SerializationUtils.ClearGlobalSerializableTypes();

            if (app != null)
            {
                var scene = app.gameObject.scene;
                if (scene.isLoaded)
                {
                    yield return(SceneManager.UnloadSceneAsync(scene));
                }

                yield return(Resources.UnloadUnusedAssets());
            }
        }
コード例 #8
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (TimeTracker < (TotalDuration + fadeDuration))
     {
         TimeTracker += Time.deltaTime;
         if (TimeTracker > TotalDuration)
         {
             callFader = true;
             Fader();
         }
     }
     else
     {
         ExperienceApp.End();
     }
     //slider.value = TimeTracker / TotalDuration;
 }
コード例 #9
0
        private static void VerifyAppSceneSetup(ExperienceApp app)
        {
            if (app == null)
            {
                throw new Exception("No ExperienceApp found in scene." +
                                    "Please ensure your scene is setup correctly. " +
                                    " Run Liminal -> Setup App Scene to prepare your scene for build."
                                    );
            }

            if (app.gameObject.GetComponentInChildren <VRAvatar>() == null)
            {
                throw new Exception(
                          "No active VRAvatar component was found inside the ExperienceApp. " +
                          " A VRAvatar is required for compatibility with the Liminal application. " +
                          " Please ensure your scene is setup correctly. Run Liminal -> Setup App Scene to prepare your scene for build."
                          );
            }
        }
コード例 #10
0
    /// <summary>
    /// End will only close the application when you're within the platform
    /// </summary>
    public void End()
    {
        StartCoroutine(routine());

        IEnumerator routine()
        {
            var elapsedTime    = 0f;
            var startingVolume = AudioListener.volume;

            ScreenFader.Instance.FadeToBlack(FadeOutTime);

            while (elapsedTime < FadeOutTime)
            {
                elapsedTime         += Time.deltaTime;
                AudioListener.volume = Mathf.Lerp(startingVolume, 0f, elapsedTime / FadeOutTime);
                yield return(new WaitForEndOfFrame());
            }

            ExperienceApp.End();
        }
    }
コード例 #11
0
        private static void SetAppData(ExperienceApp app, TextAsset jsonData, AssetLookup assetLookup)
        {
            if (app == null)
            {
                return;
            }

            var so = new SerializedObject(app);

            so.FindProperty("m_AppData").objectReferenceValue     = jsonData;
            so.FindProperty("m_AssetLookup").objectReferenceValue = assetLookup;

            var rootObjects  = app.gameObject.scene.GetRootGameObjects();
            var pRootObjects = so.FindProperty("m_RootGameObjects");

            for (int i = 0; i < rootObjects.Length; ++i)
            {
                pRootObjects.InsertArrayElementAtIndex(i);
                pRootObjects.GetArrayElementAtIndex(i).objectReferenceValue = rootObjects[i];
            }

            so.ApplyModifiedProperties();
        }
コード例 #12
0
ファイル: Test.cs プロジェクト: Pommanthebrit/Age-GDS220
 public void EndTheApp()
 {
     ExperienceApp.End();
 }
コード例 #13
0
ファイル: Quit.cs プロジェクト: WilliamC2020/Marble-Play
 public void QuitGame()
 {
     ExperienceApp.End();
 }
コード例 #14
0
 protected override void EnactSpringActions()
 {
     ExperienceApp.End();
 }