コード例 #1
0
    public void onFrameUpdate(AndroidJavaObject jo, int width, int height, bool canGoBack, bool canGoForward)
    {
        AndroidJavaObject bufferObject = jo.Get <AndroidJavaObject>("Buffer");

        byte[] bytes = AndroidJNIHelper.ConvertFromJNIArray <byte[]>(bufferObject.GetRawObject());
//        Debug.Log("frame bytes arrived");
        //Debug.Log("bytes are "+bytes.Length + " long ");
        if (bytes != null)
        {
            if (BrowserView != null)
            {
                UnityThread.executeInUpdate(() => BrowserView.SetTexture(bytes, width, height, canGoBack, canGoForward));
//                Debug.Log("new height and width: " + height + " " + width);
            }
            else
            {
                Debug.Log("TestAndroidPLugin is not set");
            }
        }
    }