Beispiel #1
0
 public void Show(TCircle circle, Color color)
 {
     m_type   = EGraphType.Circle;
     m_circle = circle;
     m_color  = color;
     isShow   = true;
 }
Beispiel #2
0
        public TCircle LimitInside(TCircle tagert)
        {
            Vector2 delta  = tagert.center - center;
            float   dr     = radius - tagert.radius;
            TCircle result = tagert;

            result.center = center + delta.normalized * Mathf.Min(delta.magnitude, dr);
            return(result);
        }
Beispiel #3
0
        public TCircle LimitInside(TCircle circle)
        {
            float   newWidth  = Mathf.Max(0, width - circle.radius * 2);
            float   newHeight = Mathf.Max(0, height - circle.radius * 2);
            TRect   newRect   = new TRect(x, y, newWidth, newHeight);
            Vector2 circlePos = newRect.LimitInside(circle.center);

            return(new TCircle(circlePos, circle.radius));
        }
Beispiel #4
0
        public static void DrawCircle(TCircle circle, Color color, string drawOncePerFrameKey = null)
        {
            if (ins == null || !CheckDrawCount(drawOncePerFrameKey))
            {
                return;
            }
            var item = ins.CreateGraph();

            if (item != null)
            {
                item.Show(circle, color);
            }
        }
Beispiel #5
0
 public void DrawScreenCircle(TCircle circle, Color color, int smooth = 50)
 {
     DrawScreenEllipse(circle.center, circle.radius, circle.radius, color, smooth);
 }
Beispiel #6
0
 public bool IsOverLapWith(TCircle circle)
 {
     return((radius + circle.radius) * (radius + circle.radius) > (center - circle.center).sqrMagnitude);
 }
Beispiel #7
0
 public static TCircle Lerp(TCircle a, TCircle b, float t)
 {
     return(new TCircle(Vector2.Lerp(a.center, b.center, t), Mathf.Lerp(a.radius, b.radius, t)));
 }
Beispiel #8
0
 private void D_C(TCircle c, Color color)
 {
     GizmosPro.DrawCircle(c, color);
 }
Beispiel #9
0
 public bool IsOverLapWith(TCircle circle)
 {
     return(IsOverLapWith(new TEllipse(circle.boundingRect)));
 }
Beispiel #10
0
 public TEllipse(TCircle circle) : this(circle.center.x, circle.center.y, circle.radius, circle.radius)
 {
 }