예제 #1
0
파일: TRect.cs 프로젝트: Airahc/hack_ssjj
        public TRect LimitInside(TRect rect)
        {
            TRect _rect = new TRect(x, y, width - rect.width * 0.5f, height - rect.height * 0.5f);
            var   pos   = _rect.LimitInside(new Vector2(rect.x, rect.y));

            return(new TRect(pos, rect.size));
        }
예제 #2
0
 public void Show(TRect rect, Color color)
 {
     m_type  = EGraphType.Rect;
     m_rect  = rect;
     m_color = color;
     isShow  = true;
 }
예제 #3
0
파일: TRect.cs 프로젝트: Airahc/hack_ssjj
        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));
        }
예제 #4
0
파일: TRect.cs 프로젝트: Airahc/hack_ssjj
        public TRect LimitInside2(TRect rect)
        {
            float   newWidth  = Mathf.Max(0, width - rect.width);
            float   newHeight = Mathf.Max(0, height - rect.height);
            TRect   newRect   = new TRect(x, y, newWidth, newHeight);
            Vector2 circlePos = newRect.LimitInside2(rect.center);

            return(new TRect(circlePos, rect.size));
        }
예제 #5
0
        public static void DrawRect(TRect rect, Color color, string drawOncePerFrameKey = null)
        {
            if (ins == null || !CheckDrawCount(drawOncePerFrameKey))
            {
                return;
            }
            var item = ins.CreateGraph();

            if (item != null)
            {
                item.Show(rect, color);
            }
        }
예제 #6
0
파일: TRect.cs 프로젝트: Airahc/hack_ssjj
        public bool IsOverLapWith(TRect rect)
        {
            float verticalDistance    = Mathf.Abs(y - rect.y);;     //垂直距离
            float horizontalDistance  = Mathf.Abs(x - rect.x);;     //水平距离
            float verticalThreshold   = (height + rect.height) / 2; //两矩形分离的垂直临界值
            float horizontalThreshold = (width + rect.width) / 2;   //两矩形分离的水平临界值

            if (verticalDistance > verticalThreshold || horizontalDistance > horizontalThreshold)
            {
                return(false);
            }
            return(true);
        }
예제 #7
0
        public void DrawScreenRect(TRect rect, Color color)
        {
            Begin(color);
            GL.Vertex3(rect.left / Screen.width, rect.top / Screen.height, 0);
            GL.Vertex3(rect.left / Screen.width, rect.bottom / Screen.height, 0);

            GL.Vertex3(rect.left / Screen.width, rect.bottom / Screen.height, 0);
            GL.Vertex3(rect.right / Screen.width, rect.bottom / Screen.height, 0);

            GL.Vertex3(rect.right / Screen.width, rect.bottom / Screen.height, 0);
            GL.Vertex3(rect.right / Screen.width, rect.top / Screen.height, 0);

            GL.Vertex3(rect.right / Screen.width, rect.top / Screen.height, 0);
            GL.Vertex3(rect.left / Screen.width, rect.top / Screen.height, 0);

            End();
        }
예제 #8
0
파일: TCircle.cs 프로젝트: Airahc/hack_ssjj
        public bool IsOverLapWith(TRect rect)
        {
            float halfWidth  = rect.width * 0.5f;
            float halfHeight = rect.height * 0.5f;
            float distanceX  = Mathf.Abs(x - rect.x);
            float distanceY  = Mathf.Abs(y - rect.y);

            if (distanceX > (halfWidth + radius) || distanceY > (halfHeight + radius))
            {
                return(false);
            }
            else if (distanceX <= halfWidth || distanceY <= halfHeight)
            {
                return(true);
            }
            float sq = (distanceX - halfWidth) * (distanceX - halfWidth)
                       + (distanceY - halfHeight) * (distanceY - halfHeight);

            return(sq <= radius * radius);
        }
예제 #9
0
파일: TRect.cs 프로젝트: Airahc/hack_ssjj
 public static TRect Lerp(TRect a, TRect b, float t)
 {
     return(new TRect(Vector2.Lerp(a.center, b.center, t), Vector2.Lerp(a.size, b.size, t)));
 }
예제 #10
0
파일: Esp.cs 프로젝트: Airahc/hack_ssjj
        void UpdateDraw()
        {
            foreach (var player in collector.players)
            {
                var model = player.model;
                if (!player.isValid)
                {
                    continue;
                }
                // if (player.isMainPlayer)
                //     continue;
                if (!Settings.isEspFriendly && player.isFriend)
                {
                    continue;
                }
                if (!model.root.gameObject.activeInHierarchy)
                {
                    continue;
                }

                var rect  = model.GetRect();
                var color = player.isFriend ? Color.green : Color.red;

                // NAME
                var tempRect = rect;
                tempRect.y = Screen.height - tempRect.y;
                var nameRect = new Rect(tempRect.center, tempRect.size);
                nameRect.y     -= nameRect.height * 0.5f + 30;
                nameRect.x      = nameRect.x - 100;
                nameRect.height = 20;
                nameRect.width  = 200;
                Color      contentColor   = GUI.contentColor;
                TextAnchor labelAlignment = GUI.skin.label.alignment;
                GUI.contentColor         = Color.black;
                GUI.skin.label.alignment = TextAnchor.MiddleCenter;
                GUI.Label(nameRect, player.name);
                nameRect.position -= Vector2.one;
                GUI.contentColor   = color;
                GUI.Label(nameRect, player.name);
                GUI.contentColor         = contentColor;
                GUI.skin.label.alignment = labelAlignment;

                if (Settings.isEspBox)
                {
                    if (rect.height != 0)
                    {
                        D_R(model.GetRect(), color);
                    }
                }

                if (Settings.isEspBoneLine)
                {
                    foreach (var line in model.GetLines())
                    {
                        D_L(line, color);
                    }
                }

                if (Settings.isEspAirLine)
                {
                    if (rect.height != 0)
                    {
                        var boxTopCenter    = new Vector2(rect.x, rect.top);
                        var screenTopCenter = new Vector2(Screen.width * 0.5f, Screen.height);
                        D_L(new TLine(boxTopCenter, screenTopCenter), color);
                    }
                }

                if (Settings.isEspHp)
                {
                    if (rect.height != 0)
                    {
                        var x  = rect.right + 4;
                        var y  = rect.bottom + 1;
                        var h  = 1f * (rect.height - 2) * player.hpRatio;
                        var p1 = new Vector2(x, y);
                        var p2 = new Vector2(x, y + h);
                        D_L(new TLine(p1, p2), color);
                        p1.x += 1; p2.x += 1;
                        D_L(new TLine(p1, p2), color);
                        p1.x += 1; p2.x += 1;
                        D_L(new TLine(p1, p2), color);
                        var bgRect = new TRect(x + 1, rect.center.y, 5, rect.height);
                        D_R(bgRect, Color.black * 0.7f);
                    }
                }
            }
        }
예제 #11
0
파일: Esp.cs 프로젝트: Airahc/hack_ssjj
 private void D_R(TRect r, Color color)
 {
     GizmosPro.DrawRect(r, color);
 }
예제 #12
0
 public TEllipse(TRect boundingRect) : this(boundingRect.center, boundingRect.size)
 {
 }