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); }
/// <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); }
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); }
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)); }
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); }
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 }
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); }
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); }