Basic example of using a WebView on a 3D Unity surface
Наследование: MonoBehaviour
Пример #1
0
        private void Init()
        {
            var bg = CreateChild <UguiSprite>("bg");

            {
                bg.Anchor = AnchorType.Fill;
                bg.Offset = Offset.Zero;
                bg.Color  = ColorPreset.DarkBackground;
            }
            image = CreateChild <WebTexture>("image");
            {
                image.Anchor = AnchorType.Fill;
                image.Offset = Offset.Zero;
            }
            var shadow = CreateChild <UguiSprite>("shadow");

            {
                shadow.Anchor = AnchorType.BottomStretch;
                shadow.Pivot  = PivotType.Bottom;
                shadow.SetOffsetHorizontal(0f);
                shadow.Y          = 0f;
                shadow.Height     = 32f;
                shadow.Color      = new Color(0f, 0f, 0f, 0.5f);
                shadow.SpriteName = "gradation-bottom";
            }

            OnEnableInited();
        }
Пример #2
0
    void Start()
    {
        webTexture = GameObject.FindObjectOfType(typeof(WebTexture)) as WebTexture;

        UWKWebView view = gameObject.GetComponent <UWKWebView>();

        view.LoadURL(UWKWebView.GetApplicationDataURL() + "/StreamingAssets/uWebKit/Examples/AlphaMaskExample.html");
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        // Get the WebTexture component of this game object.
        webTexture = this.GetComponent<WebTexture>();

        // Set a handler for the OpenExternalLink event.
        if ( webTexture != null )
            webTexture.OpenExternalLink += OnOpenExternalLink;
    }
Пример #4
0
	void Start()
	{
		webTexture = GameObject.FindObjectOfType (typeof(WebTexture)) as WebTexture;

        UWKWebView view = gameObject.GetComponent<UWKWebView>();       
        
        view.LoadURL(UWKWebView.GetApplicationDataURL() + "/StreamingAssets/uWebKit/Examples/AlphaMaskExample.html");

	}
Пример #5
0
    // Use this for initialization
    void Start()
    {
        // Get the WebTexture component of this game object.
        webTexture = this.GetComponent <WebTexture>();

        // Set a handler for the OpenExternalLink event.
        if (webTexture != null)
        {
            webTexture.OpenExternalLink += OnOpenExternalLink;
        }
    }
Пример #6
0
 void Start()
 {
     webTexture = GameObject.FindObjectOfType(typeof(WebTexture)) as WebTexture;
 }
Пример #7
0
	void Start()
	{
		webTexture = GameObject.FindObjectOfType (typeof(WebTexture)) as WebTexture;
	}
Пример #8
0
 // Use this for initialization
 void Awake()
 {
     // Get the WebTexture component of this game object.
     webTexture = this.GetComponent<WebTexture>();
 }