@@ -106,15 +106,17 @@ public static void Update()
106
106
s_depositsDestructible . Clear ( ) ;
107
107
s_mineRock5s . Clear ( ) ;
108
108
109
+ Camera mainCamera = global ::Utils . GetMainCamera ( ) ;
110
+
109
111
if ( ESP . s_showPlayerESP || ESP . s_showMonsterESP )
110
112
{
111
113
List < Character > characters = Character . GetAllCharacters ( ) ;
112
114
113
- if ( characters != null && Camera . main != null && Player . m_localPlayer != null )
115
+ if ( characters != null && mainCamera != null && Player . m_localPlayer != null )
114
116
{
115
117
foreach ( Character character in characters )
116
118
{
117
- var distance = Vector3 . Distance ( Camera . main . transform . position , character . transform . position ) ;
119
+ var distance = Vector3 . Distance ( mainCamera . transform . position , character . transform . position ) ;
118
120
119
121
if ( character . IsPlayer ( ) && ( ( Player ) character ) . GetPlayerID ( ) == Player . m_localPlayer . GetPlayerID ( ) )
120
122
{
@@ -133,11 +135,11 @@ public static void Update()
133
135
{
134
136
var pickables = UnityEngine . Object . FindObjectsOfType < Pickable > ( ) ;
135
137
136
- if ( pickables != null && Camera . main != null )
138
+ if ( pickables != null && mainCamera != null )
137
139
{
138
140
foreach ( Pickable pickable in pickables )
139
141
{
140
- var distance = Vector3 . Distance ( Camera . main . transform . position , pickable . transform . position ) ;
142
+ var distance = Vector3 . Distance ( mainCamera . transform . position , pickable . transform . position ) ;
141
143
142
144
if ( distance > 2 && ( ! ConfigManager . s_espRadiusEnabled . Value || distance < ConfigManager . s_espRadius . Value ) )
143
145
{
@@ -148,11 +150,11 @@ public static void Update()
148
150
149
151
var pickableItems = UnityEngine . Object . FindObjectsOfType < PickableItem > ( ) ;
150
152
151
- if ( pickableItems != null && Camera . main != null )
153
+ if ( pickableItems != null && mainCamera != null )
152
154
{
153
155
foreach ( PickableItem pickableItem in pickableItems )
154
156
{
155
- var distance = Vector3 . Distance ( Camera . main . transform . position , pickableItem . transform . position ) ;
157
+ var distance = Vector3 . Distance ( mainCamera . transform . position , pickableItem . transform . position ) ;
156
158
157
159
if ( distance > 2 && ( ! ConfigManager . s_espRadiusEnabled . Value || distance < ConfigManager . s_espRadius . Value ) )
158
160
{
@@ -166,11 +168,11 @@ public static void Update()
166
168
{
167
169
var itemDrops = UnityEngine . Object . FindObjectsOfType < ItemDrop > ( ) ;
168
170
169
- if ( itemDrops != null && Camera . main != null )
171
+ if ( itemDrops != null && mainCamera != null )
170
172
{
171
173
foreach ( ItemDrop itemDrop in itemDrops )
172
174
{
173
- var distance = Vector3 . Distance ( Camera . main . transform . position , itemDrop . transform . position ) ;
175
+ var distance = Vector3 . Distance ( mainCamera . transform . position , itemDrop . transform . position ) ;
174
176
175
177
if ( distance > 2 && ( ! ConfigManager . s_espRadiusEnabled . Value || distance < ConfigManager . s_espRadius . Value ) )
176
178
{
@@ -184,7 +186,7 @@ public static void Update()
184
186
{
185
187
var mineRock5s = UnityEngine . Object . FindObjectsOfType < MineRock5 > ( ) ;
186
188
187
- if ( mineRock5s != null && Camera . main != null )
189
+ if ( mineRock5s != null && mainCamera != null )
188
190
{
189
191
foreach ( MineRock5 mineRock5 in mineRock5s )
190
192
{
@@ -193,7 +195,7 @@ public static void Update()
193
195
if ( name . Contains ( "rock" ) || name . Length == 0 )
194
196
continue ;
195
197
196
- var distance = Vector3 . Distance ( Camera . main . transform . position , mineRock5 . transform . position ) ;
198
+ var distance = Vector3 . Distance ( mainCamera . transform . position , mineRock5 . transform . position ) ;
197
199
198
200
if ( distance > 2 && ( ! ConfigManager . s_espRadiusEnabled . Value || distance < ConfigManager . s_espRadius . Value ) )
199
201
{
@@ -204,7 +206,7 @@ public static void Update()
204
206
205
207
var destructibles = UnityEngine . Object . FindObjectsOfType < Destructible > ( ) ;
206
208
207
- if ( destructibles != null && Camera . main != null )
209
+ if ( destructibles != null && mainCamera != null )
208
210
{
209
211
foreach ( Destructible destructible in destructibles )
210
212
{
@@ -218,7 +220,7 @@ public static void Update()
218
220
continue ;
219
221
}
220
222
221
- var distance = Vector3 . Distance ( Camera . main . transform . position , destructible . transform . position ) ;
223
+ var distance = Vector3 . Distance ( mainCamera . transform . position , destructible . transform . position ) ;
222
224
223
225
if ( distance > 2 && ( ! ConfigManager . s_espRadiusEnabled . Value || distance < ConfigManager . s_espRadius . Value ) )
224
226
{
@@ -234,9 +236,11 @@ public static void Update()
234
236
235
237
public static void DisplayGUI ( )
236
238
{
237
- if ( Camera . main != null && Player . m_localPlayer != null )
239
+ Camera mainCamera = global ::Utils . GetMainCamera ( ) ;
240
+
241
+ if ( mainCamera != null && Player . m_localPlayer != null )
238
242
{
239
- var main = Camera . main ;
243
+ var main = mainCamera ;
240
244
var labelSkin = new GUIStyle ( InterfaceMaker . CustomSkin . label ) ;
241
245
242
246
if ( ESP . s_showPlayerESP || ESP . s_showMonsterESP )
@@ -247,11 +251,11 @@ public static void DisplayGUI()
247
251
{
248
252
continue ;
249
253
}
250
- Vector3 vector = main . WorldToScreenPoint ( character . transform . position ) ;
254
+ Vector3 vector = main . WorldToScreenPointScaled ( character . transform . position ) ;
251
255
252
256
if ( vector . z > - 1 )
253
257
{
254
- float a = Math . Abs ( main . WorldToScreenPoint ( character . GetEyePoint ( ) ) . y - vector . y ) ;
258
+ float a = Math . Abs ( main . WorldToScreenPointScaled ( character . GetEyePoint ( ) ) . y - vector . y ) ;
255
259
256
260
if ( character . IsPlayer ( ) && ESP . s_showPlayerESP )
257
261
{
@@ -280,7 +284,7 @@ public static void DisplayGUI()
280
284
{
281
285
continue ;
282
286
}
283
- Vector3 vector = main . WorldToScreenPoint ( pickable . transform . position ) ;
287
+ Vector3 vector = main . WorldToScreenPointScaled ( pickable . transform . position ) ;
284
288
285
289
if ( vector . z > - 1 )
286
290
{
@@ -295,7 +299,7 @@ public static void DisplayGUI()
295
299
{
296
300
continue ;
297
301
}
298
- Vector3 vector = main . WorldToScreenPoint ( pickableItem . transform . position ) ;
302
+ Vector3 vector = main . WorldToScreenPointScaled ( pickableItem . transform . position ) ;
299
303
300
304
if ( vector . z > - 1 )
301
305
{
@@ -315,7 +319,7 @@ public static void DisplayGUI()
315
319
{
316
320
continue ;
317
321
}
318
- Vector3 vector = main . WorldToScreenPoint ( itemDrop . transform . position ) ;
322
+ Vector3 vector = main . WorldToScreenPointScaled ( itemDrop . transform . position ) ;
319
323
320
324
if ( vector . z > - 1 )
321
325
{
@@ -336,7 +340,7 @@ public static void DisplayGUI()
336
340
{
337
341
continue ;
338
342
}
339
- Vector3 vector = main . WorldToScreenPoint ( depositDestructible . transform . position ) ;
343
+ Vector3 vector = main . WorldToScreenPointScaled ( depositDestructible . transform . position ) ;
340
344
341
345
if ( vector . z > - 1 )
342
346
{
@@ -353,7 +357,7 @@ public static void DisplayGUI()
353
357
{
354
358
continue ;
355
359
}
356
- Vector3 vector = main . WorldToScreenPoint ( mineRock5 . transform . position ) ;
360
+ Vector3 vector = main . WorldToScreenPointScaled ( mineRock5 . transform . position ) ;
357
361
358
362
if ( vector . z > - 1 )
359
363
{
0 commit comments