Example #1
0
    public UniWebViewEdgeInsets GetRect(float TopRate, float LeftRate, float RightRate, float BottomRate)
    {
        int Top    = (int)(Screen.height * TopRate);
        int Left   = (int)(Screen.width * LeftRate);
        int Bottom = (int)(Screen.height * BottomRate);
        int Right  = (int)(Screen.width * RightRate);
        UniWebViewEdgeInsets WebRect = new UniWebViewEdgeInsets(Top, Left, Bottom, Right);

        return(WebRect);
    }
    public override bool Equals(object obj)
    {
        if (obj == null || GetType() != obj.GetType())
        {
            return(false);
        }
        UniWebViewEdgeInsets uniWebViewEdgeInsets = (UniWebViewEdgeInsets)obj;

        return(top == uniWebViewEdgeInsets.top && left == uniWebViewEdgeInsets.left && bottom == uniWebViewEdgeInsets.bottom && right == uniWebViewEdgeInsets.right);
    }
Example #3
0
    /// <summary>
    /// rect : for frame,  x,y from top-left point
    ///                    width, height in normal
    ///
    /// UniWebViewEdgeInsets : distance to edge of (top, left, bottom, right)
    /// </summary>
    public void UpdateFrame()
    {
        Rect rect = NextFrameRect();

        insets = new UniWebViewEdgeInsets((int)rect.y, (int)rect.x, (int)(Screen.height - rect.y - rect.height), (int)(Screen.width - rect.x - rect.width));

        Debug.LogWarning(">>>>webview rectInfo" + rect.ToString());
        Debug.LogWarningFormat(">>>>webview EdgeInsets screenWidth,screenHeight(top,left,bottom,right) ({0},{1}), ({2},{3},{4},{5})"
                               , Screen.width, Screen.height
                               , insets.top, insets.left, insets.bottom, insets.right);
    }
Example #4
0
    private void ResizeInternal()
    {
        int screenHeight            = UniWebViewHelper.screenHeight;
        int screenWidth             = UniWebViewHelper.screenWidth;
        UniWebViewEdgeInsets insets = this.insets;

        if (this.InsetsForScreenOreitation != null)
        {
            insets = this.InsetsForScreenOreitation(this, screenHeight < screenWidth ? UniWebViewOrientation.LandScape : UniWebViewOrientation.Portrait);
        }
        this.ForceUpdateInsetsInternal(insets);
    }
Example #5
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            UniWebViewEdgeInsets anInset = (UniWebViewEdgeInsets)obj;

            return((top == anInset.top) &&
                   (left == anInset.left) &&
                   (bottom == anInset.bottom) &&
                   (right == anInset.right));
        }
Example #6
0
	private void ResizeInternal() {
		int newHeight = UniWebViewHelper.screenHeight;
		int newWidth = UniWebViewHelper.screenWidth;

		UniWebViewEdgeInsets newInset = this.insets;
		if (InsetsForScreenOreitation != null) {
			UniWebViewOrientation orientation =
				newHeight >= newWidth ? UniWebViewOrientation.Portrait : UniWebViewOrientation.LandScape;
            newInset = InsetsForScreenOreitation(this, orientation);
        }

        ForceUpdateInsetsInternal(newInset);
    }
    public override bool Equals(object obj)
    {
        if (obj == null || (object)this.GetType() != (object)obj.GetType())
        {
            return(false);
        }
        UniWebViewEdgeInsets webViewEdgeInsets = (UniWebViewEdgeInsets)obj;

        if (this.top == webViewEdgeInsets.top && this.left == webViewEdgeInsets.left && this.bottom == webViewEdgeInsets.bottom)
        {
            return(this.right == webViewEdgeInsets.right);
        }
        return(false);
    }
Example #8
0
	private void ForceUpdateInsetsInternal(UniWebViewEdgeInsets insets) {
		_insets = insets;
		UniWebViewPlugin.ChangeSize(gameObject.name,
		                            this.insets.top,
		                            this.insets.left,
		                            this.insets.bottom,
		                            this.insets.right);
		#if UNITY_EDITOR
		CreateTexture(this.insets.left,
		              this.insets.bottom,
		              Screen.width - this.insets.left - this.insets.right,
		              Screen.height - this.insets.top - this.insets.bottom
                      );
        #endif
    }
Example #9
0
 private void ForceUpdateInsetsInternal(UniWebViewEdgeInsets insets)
 {
     this._insets = insets;
     UniWebViewPlugin.ChangeInsets(((Object)((Component)this).get_gameObject()).get_name(), this.insets.top, this.insets.left, this.insets.bottom, this.insets.right);
 }
Example #10
0
 private void ForceUpdateInsetsInternal(UniWebViewEdgeInsets insets)
 {
     this._insets = insets;
     UniWebViewPlugin.ChangeInsets(base.gameObject.name, this.insets.top, this.insets.left, this.insets.bottom, this.insets.right);
 }