High-performance C# ESP framework for Unity โ€” 3D bounding boxes, 2D collider calculation, Animator skeleton bone tracking, and distance-scaled name tags.
main 1 Bintang 0 Garpu 0 Pengamat Diperbarui 2 days ago
C# 100%
Semua Aktivitas
Hanya Rilis
Mengabaikan
unreliablecode / CSharp-Unity-ESP-Framework โ€” src/ESPManager.cs [Studio Visual]
main CSHARP
ESPManager.cs ×
CSharp-Unity-ESP-Framework / src / ESPManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System.Collections.Generic;
using UnityEngine;
using CSharpESP.Renderers;

namespace CSharpESP
{
    [DisallowMultipleComponent]
    public class ESPManager : MonoBehaviour
    {
        public static ESPManager Instance { get; private set; }

        [Header("Global Settings")]
        public bool EnableESP = true;
        public Camera TargetCamera;

        [Header("Features Toggle")]
        public bool EnableBox3D = true;
        public bool EnableBox2D = false;
        public bool EnableBones = true;
        public bool EnableNameTags = true;

        [Header("Colors & Styling")]
        public Color BoxColor = new Color(0.2f, 0.8f, 1f, 1f);
        public Color BoneColor = new Color(1f, 1f, 1f, 0.9f);
        public Color TextColor = Color.white;
        public float LineThickness = 1.2f;

        private readonly List<Entities.ESPTarget> m_RegisteredTargets = new List<Entities.ESPTarget>();

        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                Destroy(gameObject);
                return;
            }
            Instance = this;
            if (TargetCamera == null)
            {
                TargetCamera = Camera.main;
            }
        }

        public void RegisterTarget(Entities.ESPTarget target)
        {
            if (!m_RegisteredTargets.Contains(target))
            {
                m_RegisteredTargets.Add(target);
            }
        }

        public void UnregisterTarget(Entities.ESPTarget target)
        {
            m_RegisteredTargets.Remove(target);
        }

        private void OnGUI()
        {
            if (!EnableESP || Event.current.type != EventType.Repaint)
                return;

            if (TargetCamera == null)
            {
                TargetCamera = Camera.main;
                if (TargetCamera == null) return;
            }

            for (int i = m_RegisteredTargets.Count - 1; i >= 0; i--)
            {
                var target = m_RegisteredTargets[i];
                if (target == null || !target.isActiveAndEnabled)
                    continue;

                Bounds bounds = target.GetBounds();

                // 1. 3D Bounding Box
                if (EnableBox3D)
                {
                    Box3DRenderer.Render(TargetCamera, bounds, BoxColor, LineThickness);
                }

                // 2. 2D Bounding Box
                if (EnableBox2D)
                {
                    Box2DRenderer.Render(TargetCamera, bounds, BoxColor, Box2DRenderer.BoxStyle.Corner, LineThickness);
                }

                // 3. Bones Skeleton
                if (EnableBones && target.Animator != null)
                {
                    BoneRenderer.Render(TargetCamera, target.Animator, BoneColor, LineThickness);
                }

                // 4. Name & Distance Tags
                if (EnableNameTags)
                {
                    NameTagRenderer.Render(TargetCamera, bounds, target.EntityName, target.CurrentHealth, target.MaxHealth, TextColor);
                }
            }
        }
    }
}
main 0 kesalahan Siap
Ln 1, Kol 1 Garis: 102 Spasi: 4 UTF-8 CRLF CSHARP