Open DevUNakamura opened 4 years ago
If you see the following error,
error CS0411: The type arguments for method 'GameObject.AddComponent<T>()' cannot be inferred from the usage. Try specifying the type arguments explicitly.
please use AddComponent<WebViewObject>()
instead of AddComponent()
.
Thank you for giving your response.
I checked your suggestion. But I could not solve my issue.
I had used "AddComponent
It can not find "enableWKWebView" parameter. I guess my source code has any mistakes. But I could not find it. My source code is below.
I hope you give me any hint to solve this issue. Best Regards.
How do you declare webViewObject
? It should be declared as below:
WebViewObject webViewObject;
Therefore the declaration of webViewObject
and the definition of Start()
method should become:
WebViewObject webViewObject;
void Start()
{
webViewObject = (new GameObject("WebViewObject")).AddComponent<WebViewObject>();
webViewObject.Init(
(msg)=>{
if (msg == "clicked") {
webViewObject.SetVisibility(false);
}
},
enableWKWebView: true);
webViewObject.LoadURL(url);
webViewObject.SetMargins(50, 100, 50, 50);
webViewObject.SetVisibility(true);
}
Thank you for giving your quick responding. I tried to solve with using your advice. But unfortunately, I could not solve current problem.
If you can support, could you please review my project. I send the link for my sample project. https://www.dropbox.com/sh/hjpmtn13ousy2ng/AABV1PsPeoetp9du89CzUw3la?dl=1
Anyway, I appreciate with your kindly support. Thanks
I checked your app. You seems to import a very old version of this plugin. Please try the latest package: https://github.com/gree/unity-webview/blob/5fcf62fe1365e5097036a8d41c3eea8c426cd592/dist/unity-webview.unitypackage
Please give me a chance to ask you. I would like to use WKWebView. I wrote following source code.
But I could not compile correctly with this source code. How can I enable WKWebView? Is there anything my mistake in my source code?
Best Regards.