protected override void OnStartView() { base.OnStartView(); var leftTopPosition = GetNodeUILeftTop(gameObject); Debug.Log("ScreenHeight = " + leftTopPosition.ToString()); _webView = new WebViewWindow(); bool result = _webView.Initialize(); if (result) { _webView.Navigating += OnNavigating; _webView.Navigated += OnNavigated; _webView.NavigateError += OnNavigateError; _webView.SetPosition(leftTopPosition.x, leftTopPosition.y, rectTransform.rect.width, rectTransform.rect.height); _webView.Navigate("https://www.baidu.com"); int i = 0; ++i; } else { _webView = null; } }
void Destory() { if (_webView != null) { _webView.Destroy(); _webView = null; } }