Exemplo n.º 1
0
    void OnEnable()
    {
        MojingLog.LogTrace("Enter Mojing.OnEnable");
        if (VRModeEnabled)
        {
            MojingSDK.Unity_EnterMojingWorld(GlassesKey, ConfigItem.MT_STATE, ConfigItem.TW_STATE);
            if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Metal && !MojingSDK.Unity_IsGlassesNeedDistortionByName(glassesKey) && !ConfigItem.TW_STATE)
            {
                MojingSDK.Unity_DestroyMetalLayer();
            }
        }

#if UNITY_IOS
        MojingSDK.Unity_StartTracker(100);
#endif

        bWaitForMojingWord = true;
        heads = FindObjectsOfType <MojingVRHead>();
        //frameCount = 0;
        StartCoroutine("EndOfFrame");
        MojingLog.LogTrace("Leave Mojing.OnEnable  ");
    }