コード例 #1
0
ファイル: WWebView.cs プロジェクト: RelinkaKing/UnityPC
        /// <summary>
        /// Setup the WWebView.
        /// </summary>
        private void Setup()
        {
            if (setup == false)
            {
                var listenerObject = new GameObject(guid);
                listener = listenerObject.AddComponent <WWebViewListener>();
                listenerObject.transform.parent = transform;
                listener.WebView = this;

#if UNIWEBVIEW3_SUPPORTED
                UniWebViewInterface.Init(listener.Name, (int)position.x, (int)position.y, (int)size.x, (int)size.y);
#elif UNIWEBVIEW2_SUPPORTED
                UniWebViewPlugin.Init(listener.Name, (int)position.y, (int)position.x, (int)position.w, (int)position.z);
#else
                WWebViewPlugin.Init(listener.Name, (int)position.y, (int)position.x, (int)position.w, (int)position.z, (int)size.x, (int)size.y);
#endif
                setup = true;
            }
        }
コード例 #2
0
    private void _init()
    {
        Rect       rect;
        GameObject obj2 = new GameObject(this.id);

        this.listener         = obj2.AddComponent <UniWebViewNativeListener>();
        obj2.transform.parent = base.transform;
        this.listener.webView = this;
        UniWebViewNativeListener.AddListener(this.listener);
        if (this.fullScreen)
        {
            rect = new Rect(0f, 0f, (float)GameLogic.ScreenWidth, (float)GameLogic.ScreenHeight);
        }
        else
        {
            rect = this.NextFrameRect();
        }
        UniWebViewInterface.Init(this.listener.Name, (int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
        this.isPortrait = GameLogic.ScreenHeight >= GameLogic.ScreenWidth;
    }
コード例 #3
0
ファイル: UniWebView.cs プロジェクト: freedomWind/pWebview
    void Awake()
    {
        var listenerObject = new GameObject(id);

        listener = listenerObject.AddComponent <UniWebViewNativeListener>();
        listenerObject.transform.parent = transform;
        listener.webView = this;

        Rect rect;

        if (fullScreen)
        {
            rect = new Rect(0, 0, Screen.width, Screen.height);
        }
        else
        {
            rect = NextFrameRect();
        }

        UniWebViewInterface.Init(listener.Name, (int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
        isPortrait = Screen.height >= Screen.width;
    }