示例#1
0
 public static Vector2 ToVector2(this ToastAnchor self)
 {
     return(self switch
     {
         ToastAnchor.LeftTop => new Vector2(0, 1F),
         ToastAnchor.CenterTop => new Vector2(0.5F, 1F),
         ToastAnchor.RightTop => new Vector2(1F, 1F),
         ToastAnchor.LeftBottom => new Vector2(0, 0),
         ToastAnchor.CenterBottom => new Vector2(0.5F, 0),
         ToastAnchor.RightBottom => new Vector2(1F, 0),
         _ => Vector2.zero
     });
示例#2
0
 public static bool IsBottom(this ToastAnchor self)
 {
     return(Math.Abs(self.ToVector2().y - (-1F)) < EPS);
 }
示例#3
0
 public static bool IsRight(this ToastAnchor self)
 {
     return(Math.Abs(self.ToVector2().x - 1F) < EPS);
 }