Esempio n. 1
0
    void Start()
    {
        tex           = Resources.Load("star") as Texture;
        LCamera       = GameObject.Find("MojingMain/MojingVrHead/VR Camera Left").GetComponent <Camera>();
        RCamera       = GameObject.Find("MojingMain/MojingVrHead/VR Camera Right").GetComponent <Camera>();
        CenterPointer = GameObject.Find("MojingMain/MojingVrHead/GazePointer").transform;

        size           = MojingSDK.Unity_GetTextureSize();
        HeadCtrlOffset = new Vector2(size * 0.5f, size * 0.5f);
        texID          = tex.GetNativeTexturePtr();
    }
Esempio n. 2
0
    void Start()
    {
        //MojingInputManager.DeviceAttachedCallback += onDeviceAttachedCallback;

        CenterPointer = GameObject.Find("MojingMain/MojingVrHead/GazePointer").transform;
        UICamera      = GameObject.Find("UICamera").GetComponent <Camera>();
        int size = MojingSDK.Unity_GetTextureSize();

        UIScreen              = new RenderTexture(size, size, 24, RenderTextureFormat.Default);
        UIScreen.anisoLevel   = 0;
        UIScreen.antiAliasing = Mathf.Max(QualitySettings.antiAliasing, 1);
        UIScreen.Create();
        UICamera.targetTexture = UIScreen;
        texID = UIScreen.GetNativeTexturePtr();
    }
Esempio n. 3
0
    void Start()
    {
        LCamera       = GameObject.Find("MojingMain/MojingVrHead/VR Camera Left").GetComponent <Camera>();
        RCamera       = GameObject.Find("MojingMain/MojingVrHead/VR Camera Right").GetComponent <Camera>();
        CenterPointer = GameObject.Find("MojingMain/MojingVrHead/GazePointer").transform;
        UICamera      = GameObject.Find("UICamera").GetComponent <Camera>();

        int size = MojingSDK.Unity_GetTextureSize();

        UIScreen              = new RenderTexture(size, size, 24, RenderTextureFormat.Default);
        UIScreen.anisoLevel   = 0;
        UIScreen.antiAliasing = Mathf.Max(QualitySettings.antiAliasing, 1);

        UICamera.targetTexture = UIScreen;

        if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Metal)         //Metal Rendering
        {
            texID = UIScreen.colorBuffer.GetNativeRenderBufferPtr();
        }
        else
        {
            texID = UIScreen.GetNativeTexturePtr();
        }
    }