From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../UniWebView/Script/UniWebViewEdgeInsets.cs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs (limited to 'Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs') diff --git a/Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs b/Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs new file mode 100644 index 00000000..88cb8755 --- /dev/null +++ b/Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs @@ -0,0 +1,55 @@ +// +// UniWebViewEdgeInsets.cs +// Created by Wang Wei(@onevcat) on 2013-10-20. +// + +[System.Serializable] +/// +/// This class defined the edge inset of a UniWebView +/// +public class UniWebViewEdgeInsets { + + public int top, left, bottom, right; + + /// + /// Initializes a new instance of the class. + /// + /// Top inset by point. + /// Left inset by point. + /// Bottominset by point. + /// Rightinset by point. + public UniWebViewEdgeInsets(int aTop, int aLeft, int aBottom, int aRight) { + top = aTop; + left = aLeft; + bottom = aBottom; + right = aRight; + } + + public static bool operator ==(UniWebViewEdgeInsets inset1, UniWebViewEdgeInsets inset2) + { + return inset1.Equals(inset2); + } + + public static bool operator !=(UniWebViewEdgeInsets inset1, UniWebViewEdgeInsets inset2) + { + return !inset1.Equals(inset2); + } + + public override int GetHashCode() + { + var calculation = top + left + bottom + right; + return calculation.GetHashCode(); + } + + 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); + } +} -- cgit v1.1-26-g67d0