static int QPYX_LoadHTML_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 3); WebViewObject QPYX_obj_YXQP = (WebViewObject)ToLua.CheckObject <WebViewObject>(L_YXQP, 1); string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2); string QPYX_arg1_YXQP = ToLua.CheckString(L_YXQP, 3); QPYX_obj_YXQP.LoadHTML(QPYX_arg0_YXQP, QPYX_arg1_YXQP); return(0); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
private void OnEnable() { _object = new GameObject($"webview-{++_counter:X4}"); _webview = _object.AddComponent <WebViewObject>(); _webview.Init( ld: OnWebviewLoaded, enableWKWebView: true ); _webview.SetVisibility(_visible = visible); _webview.SetMargins(0, 0, 0, 0); Debug.Log("webview init"); var path = Path.Combine(Application.streamingAssetsPath, "sample.html"); var data = File.ReadAllBytes(path); Debug.Log($"html loaded: {data.Length} bytes"); _webview.LoadHTML(Encoding.UTF8.GetString(data), null); }