/// <summary>
 /// Returns the actual Anchor Point Vector value based on anchor
 /// </summary>
 /// <param name="anchor">Anchor to be used to calculate the actual value</param>
 /// <returns>A Vector2 containing the actual Anchor Point value, normalized.</returns>
 public static Vector2 GetAnchorPointValue(Anchor anchor)
 {
     Vector2 a = Vector2.zero;
     switch (anchor)
     {
         case Anchor.Bottom:
             a.x = 0.5f;
             a.y = 1;
             break;
         case Anchor.Bottom_Left:
             a.y = 1;
             break;
         case Anchor.Bottom_Right:
             a.x = a.y = 1;
             break;
         case Anchor.Center:
             a.x = a.y = 0.5f;
             break;
         case Anchor.Custom:
             break;
         case Anchor.Left:
             a.y = 0.5f;
             break;
         case Anchor.Right:
             a.x = 1;
             a.y = 0.5f;
             break;
         case Anchor.Top:
             a.x = 0.5f;
             break;
         case Anchor.Top_Left:
             break;
         case Anchor.Top_Right:
             a.x = 1;
             break;
     }
     return a;
 }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ImageAdapter()
 {
     MinWidth = 10;
     MinHeight = 10;
     TilingAnchor = Anchor.TopLeft;
 }
Beispiel #3
0
 public static void OpenDocInMenu(string docPath, bool onlyThirdPartyApp, Anchor anchor = Anchor.Bottom)
 {
     OpenDocumentInMenu (docPath, onlyThirdPartyApp, anchor);
 }
Beispiel #4
0
 private static extern void OpenDocumentInMenu(string docPath, bool onlyThirdPartyApp, Anchor anchor);
Beispiel #5
0
 public static void Resize(this RectTransform _trans, Anchor _anchor, Vector2 offsetMin, Vector2 offsetMax)
 {
     _trans.Resize(_anchor.Min, _anchor.Max, offsetMin, offsetMax);
 }