protected virtual void Start() { Debug.Log("Start() New spawn: " + m_newSpawn.ToString() + " Auth: " + hasAuthority.ToString()); Debug.Log("Creator: " + m_creator + " Self: " + IAAPlayer.localPlayer.netId.Value); if (m_newSpawn) { if (hasAuthority || IAAPlayer.localPlayer.netId.Value == m_creator) { if (!hasAuthority) { Debug.Log("Seems like an Unity bug. Auth comes too late."); } m_opstate = OpState.Op_NewSpawn; } m_newSpawn = false; } if (m_looping) { m_highlight.ConstantOnImmediate(HighlightColour); m_sequencer.setCometVisibility(true); if (!m_sequencer.loadedFromScene) { IAAPlayer.localPlayer.CmdGetSoundObjectSequencePath(netId); } else { IAAPlayer.localPlayer.CmdSoundObjectStartSequencer(netId); } } else if (m_drawingSequence) { m_highlight.FlashingOn(); } }
/// <summary> /// 创建虚影模型 /// </summary> /// <param name="modelNode"></param> public void CreateGhostModels(Transform modelNode) { if (_traShadowNode != null) { return; } switch (shadowType) { case ShadowType.Auto: CreateGhost(modelNode); break; case ShadowType.Manual: _traShadowNode = traModelNode; var renders = _traShadowNode.GetComponentsInChildren <Renderer>(); foreach (var item in renders) { SetMaterial(item.gameObject); } highlighter = _traShadowNode.gameObject.AddComponent <Highlighter>(); highlighter.ConstantOnImmediate(color); break; default: break; } //创建虚影模型 }
public void SetStepHighLighting(PBKeyFrame curKeyFrame) { if (!mIsShowStepHighlight) { return; } foreach (PBKeyFrameItem item in curKeyFrame.KeyFrameItems) { if (item.PosNotChange || item.Target.name == "section_0") { continue; } PBBlock[] blocks = item.Target.GetComponentsInChildren <PBBlock>(); for (int i = 0; i < blocks.Length; ++i) { if (blocks[i].hide) { continue; } Highlighter high = blocks[i].gameObject.AddSingleComponent <Highlighter>(); // if (high.seeThrough) // high.SeeThroughOff(); high.ConstantOnImmediate(mHighlightColor); } } }
public override void Highlight(Color?color = default(Color?), float duration = 0) { if (color == null) { return; } else { _highLighter.ReinitMaterials(); if (OutLineColor == Color.clear) { _highLighter.ConstantOnImmediate((Color)color); } else { _highLighter.ConstantOnImmediate(OutLineColor); } } }
public void SetHL(bool b) { if (b) { h.ConstantOnImmediate(hoverColor); } else { h.ConstantOffImmediate(); } }
/// <summary> /// 显示高亮 /// </summary> public void ShowHighLight(bool isGrab = false) { //获取到子物体下的所有高亮脚本 var highlights = highLightTransform.GetComponentsInChildren <HighlightObject>().Where(obj => obj != this); switch (highlightType) { case HighLightType.Model: if (highlightModel != null && highlightModel.activeSelf == false && _isHighlight) { highlightModel.SetActive(true); } //显示子物体下的所有高亮 foreach (var item in highlights) { if (item.highlightModel != null && item.highlightModel.activeSelf == false && item._isHighlight) { item.highlightModel.SetActive(true); } } break; case HighLightType.Shader: //移除子物体下的所有高亮 foreach (var item in highlights) { //移除子物体 item.OnRemoveHighLight(); } if (h == null) { OnAddHighLight(); } //脚本重置下 h.enabled = false; h.enabled = true; //h.ConstantOnImmediate(isGrab ? grabColor : highlightColor); h.ConstantOnImmediate(highlightColor); break; default: break; } }
/// <summary> /// 高亮设备 /// </summary> /// <param name="isHighLightLastOff">是否关闭上一个物体的高亮</param> public virtual void HighlightOn(bool isHighLightLastOff = true) { Highlighter h = gameObject.AddMissingComponent <Highlighter>(); Color colorConstant = Color.green; //SetOcculuderState(false); h.ConstantOnImmediate(colorConstant); HighlightManage manager = HighlightManage.Instance; if (manager && isHighLightLastOff) { manager.SetHightLightDep(this); } }
protected override void OnInitialize() { highlighter = GetComponent <Highlighter>(); Core.IsAlive.Subscribe(x => { if (x) { highlighter.ConstantOnImmediate(this.PlayerId.ToColor()); } else { highlighter.ConstantOff(); } }); }
/// <summary> /// 创建模型虚影 /// </summary> /// <param name="modelNode">模型</param> private void CreateGhost(Transform modelNode) { _traShadowNode = CreateShadowObject(null, modelNode.transform).transform; _traShadowNode.localPosition = modelNode.localPosition; _traShadowNode.localRotation = modelNode.localRotation; _traShadowNode.localScale = modelNode.localScale; //获取到模型的所有节点 //然后生成Null的 CreateNode(modelNode, _traShadowNode); //添加虚影高亮组件 highlighter = _traShadowNode.gameObject.AddComponent <Highlighter>(); highlighter.ConstantOnImmediate(color); }
// void Update() { float time = Time.time; if (time >= start + delay) { state = !state; start = time; delay = Random.Range(delayMin, delayMax); if (state) { Color color = Highlighter.HSVToRGB(Random.value, 1f, 1f); highlighter.ConstantOnImmediate(color); } else { highlighter.ConstantOffImmediate(); } } }
/// <summary> /// API:修改物体是否开启高亮 /// </summary> /// <param name="showHightlight">是否开启高亮</param> /// <param name="type">高亮类型</param> public void SwithHightlight(bool showHightlight, HighlightType type) { switch (type) { case HighlightType.Once: if (showHightlight) { h.ConstantOnImmediate(highlightColor); } else { h.ConstantOffImmediate(); } break; case HighlightType.Constant: if (showHightlight) { h.ConstantOn(highlightColor); } else { h.ConstantOff(); } break; case HighlightType.Flash: if (showHightlight) { h.FlashingOn(highlightColor, new Color(0, 0, 0, 0)); } else { h.TweenStop(); } break; } }
/// <summary> /// 打开虚影 /// </summary> /// <param name="targetPos"></param> /// <param name="position"></param> /// <param name="rotate"></param> public void OpenGhost(Transform targetPos, Vector3 position = default(Vector3), Vector3 scale = default(Vector3), Quaternion rotate = default(Quaternion), bool isLocal = true) { if (_traShadowNode == null) //虚影缓存为空时新建虚影 { CreateGhostModels(targetPos); } _traShadowNode.parent = node; if (isLocal) { _traShadowNode.localPosition = position; _traShadowNode.localRotation = rotate; } else { _traShadowNode.position = position; _traShadowNode.rotation = rotate; } //_traShadowNode.localScale = scale; if (_traShadowNode.gameObject.activeSelf == false) { _traShadowNode.gameObject.SetActive(true); } highlighter?.ConstantOnImmediate(color); }
void OnGUI() { if (!Provider.isConnected || Provider.isLoading || (PlayerCam.IsFullScreen && PlayerCam.player != null)) { return; } #region Item Clump Boxes if (G.Settings.ItemOptions.Enabled && G.Settings.GlobalOptions.ListClumpedItems && !G.BeingSpied) { for (int i = 0; i < ItemClumps.Count; i++) { ItemClumpObject itemClumpObject = ItemClumps[i]; Vector3 pos = G.MainCamera.WorldToScreenPoint(itemClumpObject.WorldPos); pos.y = Screen.height - pos.y; if (pos.z >= 0 && (Vector3.Distance(Player.player.transform.position, itemClumpObject.WorldPos) <= G.Settings.ItemOptions.MaxDistance)) { string s = ""; foreach (InteractableItem item in itemClumpObject.ClumpedItems) { Color c1 = ItemTool.getRarityColorHighlight(item.asset.rarity); Color32 c = new Color32((byte)(c1.r * 255), (byte)(c1.g * 255), (byte)(c1.b * 255), 255); s += $"<color=#{Colors.ColorToHex(c)}>{item.asset.itemName}</color>\n"; } Vector2 TextHeight = GUIStyle.none.CalcSize(new GUIContent($"<size=10>{s}</size>")); GUILayout.BeginArea(new Rect(pos.x, pos.y, TextHeight.x + 10, TextHeight.y), style: "box"); GUILayout.Label($"<size=10>{s}</size>"); GUILayout.EndArea(); } } } GUI.skin = null; #endregion for (int i = 0; i < EObjects.Count; i++) { ESPObj obj = EObjects[i]; #region Checks if (obj.GObject != null && (!obj.Options.Enabled || T.GetDistance(obj.GObject.transform.position) > obj.Options.MaxDistance || (obj.Target == ESPObject.Item && (!T.IsItemWhitelisted((InteractableItem)obj.Object, G.Settings.MiscOptions.ESPWhitelist) || Items.IsAlreadyClumped((InteractableItem)obj.Object))))) { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } } if (obj.GObject == null || !T.InScreenView(G.MainCamera.WorldToViewportPoint(obj.GObject.transform.position)) || !obj.Options.Enabled || T.GetDistance(obj.GObject.transform.position) > obj.Options.MaxDistance) { continue; } if (G.BeingSpied) { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } T.RemoveShaders(obj.GObject); continue; } if (obj.Target == ESPObject.Player && ((SteamPlayer)obj.Object).player.life.isDead) { continue; } if (obj.Target == ESPObject.Zombie && ((Zombie)obj.Object).isDead) { continue; } if (obj.Target == ESPObject.Vehicle && ((InteractableVehicle)obj.Object).isDead) { continue; } if (obj.Target == ESPObject.Vehicle && G.Settings.GlobalOptions.OnlyUnlocked && ((InteractableVehicle)obj.Object).isLocked) { continue; } if (obj.Target == ESPObject.Bed && G.Settings.GlobalOptions.OnlyUnclaimed && ((InteractableBed)obj.Object).isClaimed) { continue; } if (obj.Target == ESPObject.Item && !T.IsItemWhitelisted((InteractableItem)obj.Object, G.Settings.MiscOptions.ESPWhitelist)) { continue; } if (obj.Target == ESPObject.Item && G.Settings.GlobalOptions.ListClumpedItems && Items.IsAlreadyClumped((InteractableItem)obj.Object)) { continue; } if (G.BeingSpied) { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } T.RemoveShaders(obj.GObject); continue; } #endregion #region Globals string LabelText = $"<size={obj.Options.FontSize}>"; string OutlineText = $"<size={obj.Options.FontSize}>"; Color32 color = Colors.GetColor(Enum.GetName(typeof(ESPObject), obj.Target) + "_ESP"); if (obj.Options.Distance) { LabelText += $"<color=white>[{T.GetDistance(obj.GObject.transform.position)}]</color> "; OutlineText += $"[{T.GetDistance(obj.GObject.transform.position)}] "; } #endregion #region Label Shit switch (obj.Target) { case ESPObject.Player: Player player = ((SteamPlayer)obj.Object).player; switch (T.GetPriority(((SteamPlayer)obj.Object).playerID.steamID.m_SteamID)) { case Priority.Friendly: color = Colors.GetColor("Friendly_Player_ESP"); break; case Priority.Marked: color = Colors.GetColor("Marked_Player_ESP"); break; } if (obj.Options.Name) { LabelText += ((SteamPlayer)obj.Object).playerID.characterName; OutlineText += ((SteamPlayer)obj.Object).playerID.characterName; } if (G.Settings.GlobalOptions.Weapon) { string Weapon = player.equipment.asset != null ? ((SteamPlayer)obj.Object).player.equipment.asset.itemName : "None"; LabelText += $"<color=white> - {Weapon}</color>"; OutlineText += " - " + Weapon; } if (G.Settings.GlobalOptions.ViewHitboxes && G.Settings.AimbotOptions.ExpandHitboxes && G.Settings.AimbotOptions.SilentAim) { Player p = ((SteamPlayer)obj.Object).player; Vector3 W2SPlayer = T.WorldToScreen(player.transform.position); if (W2SPlayer.z >= 0) { Vector3 W2SOffset = T.WorldToScreen(new Vector3(player.transform.position.x, player.transform.position.y + G.Settings.AimbotOptions.HitboxSize, player.transform.position.z)); float Distance = Vector3.Distance(W2SPlayer, W2SOffset); T.DrawCircle(Colors.GetColor("Extended_Hitbox_Circle"), new Vector2(W2SPlayer.x, W2SPlayer.y), Distance); } } break; case ESPObject.Item: if (obj.Options.Name) { LabelText += ((InteractableItem)obj.Object).asset.itemName; OutlineText += ((InteractableItem)obj.Object).asset.itemName; } break; case ESPObject.Vehicle: if (obj.Options.Name) { LabelText += ((InteractableVehicle)obj.Object).asset.vehicleName; OutlineText += ((InteractableVehicle)obj.Object).asset.vehicleName; } if (G.Settings.GlobalOptions.VehicleLocked) { if (((InteractableVehicle)obj.Object).isLocked) { LabelText += $"<color=white> - Locked</color>"; OutlineText += " - Locked"; } else { LabelText += $"<color=white> - </color><color=ff5a00>Unlocked</color>"; OutlineText += " - Unlocked"; } } break; case ESPObject.Bed: if (obj.Options.Name) { LabelText += Enum.GetName(typeof(ESPObject), obj.Target); OutlineText += Enum.GetName(typeof(ESPObject), obj.Target); } if (G.Settings.GlobalOptions.Claimed) { if (((InteractableBed)obj.Object).isClaimed) { LabelText += $"<color=white> - Claimed</color>"; OutlineText += " - Claimed"; } else { LabelText += $"<color=white> - </color><color=ff5a00>Unclaimed</color>"; OutlineText += " - Unclaimed"; } } break; case ESPObject.Storage: BarricadeData bdata = null; if (obj.Options.Name || G.Settings.GlobalOptions.ShowLocked) { try { BarricadeRegion r; if (BarricadeManager.tryGetInfo(((InteractableStorage)obj.Object).transform, out byte x, out byte y, out ushort plant, out ushort index, out r)) { bdata = r.barricades[index]; } } catch (Exception ex) { Debug.Log(ex); } } if (obj.Options.Name) { string s = "Storage"; if (bdata != null) { s = bdata.barricade.asset.name.Replace("_", " "); } LabelText += s; OutlineText += s; } if (G.Settings.GlobalOptions.ShowLocked) { if (bdata != null) { if (bdata.barricade.asset.isLocked) { LabelText += $"<color=white> - Locked</color>"; OutlineText += " - Locked"; } else { LabelText += $"<color=white> - </color><color=ff5a00>Unlocked</color>"; OutlineText += " - Unlocked"; } } else { LabelText += $"<color=white> - Unknown</color>"; OutlineText += " - Unknown"; } } break; default: if (obj.Options.Name) { LabelText += Enum.GetName(typeof(ESPObject), obj.Target); OutlineText += Enum.GetName(typeof(ESPObject), obj.Target); } break; } #endregion #region Draw LabelText += "</size>"; OutlineText += "</size>"; if (obj.Options.Tracers) { T.DrawSnapline(obj.GObject.transform.position, color); } if (!String.IsNullOrEmpty(LabelText)) { T.DrawESPLabel(obj.GObject.transform.position, color, Color.black, LabelText, OutlineText); } if (obj.Options.Box) { if (obj.Target == ESPObject.Player) { Vector3 p = obj.GObject.transform.position; Vector3 s = obj.GObject.transform.localScale; if (p != null & s != null) { T.Draw3DBox(new Bounds(p + new Vector3(0, 1.1f, 0), s + new Vector3(0, .95f, 0)), color); } } else { T.Draw3DBox(obj.GObject.GetComponent <Collider>().bounds, color); } } if (obj.Options.Glow) { Highlighter h = obj.GObject.GetComponent <Highlighter>() ?? obj.GObject.AddComponent <Highlighter>(); h.occluder = true; h.overlay = true; h.ConstantOnImmediate(color); } else { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } } #endregion } // sometimes shows localplayer glowing after your car explodes Highlighter hi = Player.player?.gameObject?.GetComponent <Highlighter>(); if (hi != null) { hi.ConstantOffImmediate(); } }
// void Start() { highlighter.ConstantOnImmediate(color); }
public static void DoGlow() { foreach (SteamPlayer play in Provider.clients) { if (play.player == Player.player) { continue; } Highlighter Highlighter = play.player.gameObject.GetComponent <Highlighter>(); if ((Global.VisualsEnabled && Global.VisSettings.Glow) && !Global.AllOff && !Hooks.askScreenshot.NeedingSpy) { if (Highlighter == null) { Highlighter = play.player.gameObject.AddComponent <Highlighter>(); } //Deprecated, http://docs.deepdream.games/HighlightingSystem/5.0/#toc9.1upgrading_from_v4.3_to_v5.0 //Highlighter.SeeThroughOn(); //Highlighter.OccluderOn(); //Color blue if in group if (play.player.quests.groupID == Player.player.quests.groupID) { Highlighter.ConstantOnImmediate(Color.blue); } else { Highlighter.ConstantOnImmediate(Color.yellow); } } else if (Highlighter != null) { Highlighter.ConstantOffImmediate(); MonoBehaviour.Destroy(Highlighter); } } if (Global.VisSettings.Items) { foreach (ItemRegion region in ItemManager.regions) { foreach (ItemDrop drop in region.drops) { if (drop.interactableItem.asset is ItemGunAsset) { EItemRarity rar = ((ItemGunAsset)drop.interactableItem.asset).rarity; if (rar == EItemRarity.COMMON || rar == EItemRarity.UNCOMMON || rar == EItemRarity.RARE) { continue; } Highlighter Highlighter = drop.interactableItem.gameObject.GetComponent <Highlighter>(); if (Global.VisualsEnabled && Global.VisSettings.Glow && !Global.AllOff && !Hooks.askScreenshot.NeedingSpy) { if (Highlighter == null) { Highlighter = drop.interactableItem.gameObject.AddComponent <Highlighter>(); } Highlighter.ConstantOnImmediate(Color.white); } else if (Highlighter != null) { Highlighter.ConstantOffImmediate(); MonoBehaviour.Destroy(Highlighter); } } } } } if (Hooks.askScreenshot.NeedingSpy) { System.Threading.Thread.Sleep(85); Hooks.askScreenshot.GlowReady = true; } }
// Token: 0x060001F3 RID: 499 RVA: 0x00012908 File Offset: 0x00010B08 public void OnGUI() { Player mainPlayer = OptimizationVariables.MainPlayer; bool flag = mainPlayer == null; object obj; if (flag) { obj = null; } else { PlayerEquipment equipment = mainPlayer.equipment; obj = ((equipment != null) ? equipment.useable : null); } UseableGun useableGun = obj as UseableGun; bool flag2 = useableGun == null || TrajectoryComponent.spying || !WeaponOptions.EnableBulletDropPrediction || !Provider.modeConfigData.Gameplay.Ballistics; bool flag3 = flag2; if (flag3) { bool flag4 = TrajectoryComponent.Highlighted != null; bool flag5 = flag4; if (flag5) { TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted); TrajectoryComponent.Highlighted = null; } } else { RaycastHit raycastHit; List <Vector3> list = TrajectoryComponent.PlotTrajectory(useableGun, out raycastHit, 255); bool flag6 = Vector3.Distance(list.Last <Vector3>(), OptimizationVariables.MainPlayer.look.aim.position) > useableGun.equippedGunAsset.range; ColorVariable color = ColorUtilities.getColor("_TrajectoryPredictionInRange"); ColorVariable color2 = ColorUtilities.getColor("_TrajectoryPredictionOutOfRange"); bool flag7 = WeaponOptions.HighlightBulletDropPredictionTarget && raycastHit.collider != null; bool flag8 = flag7; if (flag8) { Transform transform = raycastHit.transform; GameObject gameObject = null; bool flag9 = DamageTool.getPlayer(transform) != null; bool flag10 = flag9; if (flag10) { gameObject = DamageTool.getPlayer(transform).gameObject; } else { bool flag11 = DamageTool.getZombie(transform) != null; bool flag12 = flag11; if (flag12) { gameObject = DamageTool.getZombie(transform).gameObject; } else { bool flag13 = DamageTool.getAnimal(transform) != null; bool flag14 = flag13; if (flag14) { gameObject = DamageTool.getAnimal(transform).gameObject; } else { bool flag15 = DamageTool.getVehicle(transform) != null; bool flag16 = flag15; if (flag16) { gameObject = DamageTool.getVehicle(transform).gameObject; } } } } bool flag17 = gameObject != null; bool flag18 = flag17; if (flag18) { Highlighter highlighter = gameObject.GetComponent <Highlighter>() ?? gameObject.AddComponent <Highlighter>(); bool flag19 = !highlighter.enabled; bool flag20 = flag19; if (flag20) { highlighter.occluder = true; highlighter.overlay = true; highlighter.ConstantOnImmediate(flag6 ? color2 : color); } bool flag21 = TrajectoryComponent.Highlighted != null && highlighter != TrajectoryComponent.Highlighted; bool flag22 = flag21; if (flag22) { TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted); } TrajectoryComponent.Highlighted = highlighter; } else { bool flag23 = TrajectoryComponent.Highlighted != null; bool flag24 = flag23; if (flag24) { TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted); TrajectoryComponent.Highlighted = null; } } } else { bool flag25 = !WeaponOptions.HighlightBulletDropPredictionTarget && TrajectoryComponent.Highlighted != null; bool flag26 = flag25; if (flag26) { TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted); TrajectoryComponent.Highlighted = null; } } ESPComponent.GLMat.SetPass(0); GL.PushMatrix(); GL.LoadProjectionMatrix(OptimizationVariables.MainCam.projectionMatrix); GL.modelview = OptimizationVariables.MainCam.worldToCameraMatrix; GL.Begin(2); GL.Color(flag6 ? color2 : color); foreach (Vector3 v in list) { GL.Vertex(v); } GL.End(); GL.PopMatrix(); } }
public void OnGUI() { if (Event.current.type != EventType.Repaint || !ESPOptions.Enabled) return; if (!DrawUtilities.ShouldRun()) return; GUI.depth = 1; if (MainCamera == null) MainCamera = OptimizationVariables.MainCam; Vector3 localPos = OptimizationVariables.MainPlayer.transform.position; Vector3 aimPos = OptimizationVariables.MainPlayer.look.aim.position; Vector3 aimForward = OptimizationVariables.MainPlayer.look.aim.forward; for (int i = 0; i < ESPVariables.Objects.Count; i++) { ESPObject obj = ESPVariables.Objects[i]; ESPVisual visual = ESPOptions.VisualOptions[(int)obj.Target]; GameObject go = obj.GObject; if (!visual.Enabled) { Highlighter highlighter = go.GetComponent<Highlighter>(); if (highlighter != null && highlighter != TrajectoryComponent.Highlighted) highlighter.ConstantOffImmediate(); continue; } if (obj.Target == ESPTarget.Items && ESPOptions.FilterItems) if (!ItemUtilities.Whitelisted(((InteractableItem)obj.Object).asset, ItemOptions.ItemESPOptions)) continue; Color c = ColorUtilities.getColor($"_{obj.Target}"); LabelLocation ll = visual.Location; if (go == null) continue; Vector3 position = go.transform.position; double dist = VectorUtilities.GetDistance(position, localPos); if (dist < 0.5 || (dist > visual.Distance && !visual.InfiniteDistance)) continue; Vector3 cpos = MainCamera.WorldToScreenPoint(position); if (cpos.z <= 0) continue; string text = ""; Vector3 scale = go.transform.localScale; Bounds b; switch (obj.Target) { case ESPTarget.Players: case ESPTarget.Zombies: b = new Bounds(new Vector3(position.x, position.y + 1, position.z), new Vector3(scale.x * 2, scale.y * 3, scale.z * 2)); break; case ESPTarget.Vehicles: b = go.transform.Find("Model_0").GetComponent<MeshRenderer>().bounds; Transform child = go.transform.Find("Model_1"); if (child != null) b.Encapsulate(child.GetComponent<MeshRenderer>().bounds); break; default: b = go.GetComponent<Collider>().bounds; break; } int size = DrawUtilities.GetTextSize(visual, dist); double rounded = Math.Round(dist); /*#if DEBUG DebugUtilities.Log(obj.Target.ToString()); //Holy f**k nuggets this is laggy #endif*/ string outerText = $"<size={size}>"; text = $"<size={size}>"; switch (obj.Target) { #region Players case ESPTarget.Players: { Player p = (Player)obj.Object; if (p.life.isDead) continue; if (visual.ShowName) text += GetSteamPlayer(p).playerID.characterName + "\n"; if (RaycastUtilities.TargetedPlayer == p && RaycastOptions.EnablePlayerSelection) text += "[Targeted]\n"; if (ESPOptions.ShowPlayerWeapon) text += (p.equipment.asset != null ? p.equipment.asset.itemName : "Fists") + "\n"; if (ESPOptions.ShowPlayerVehicle) text += (p.movement.getVehicle() != null ? p.movement.getVehicle().asset.name + "\n" : "No Vehicle\n"); b.size = b.size / 2; b.size = new Vector3(b.size.x, b.size.y * 1.25f, b.size.z); if (FriendUtilities.IsFriendly(p) && ESPOptions.UsePlayerGroup) c = ColorUtilities.getColor("_ESPFriendly"); break; } #endregion #region Zombies case ESPTarget.Zombies: { if (((Zombie)obj.Object).isDead) continue; if (visual.ShowName) text += $"Zombie\n"; break; } #endregion #region Items case ESPTarget.Items: { InteractableItem item = (InteractableItem)obj.Object; if (visual.ShowName) text += item.asset.itemName + "\n"; break; } #endregion #region Sentries case ESPTarget.Sentries: { InteractableSentry sentry = (InteractableSentry)obj.Object; if (visual.ShowName) { text += "Sentry\n"; outerText += "Sentry\n"; } if (ESPOptions.ShowSentryItem) { outerText += SentryName(sentry.displayItem, false) + "\n"; text += SentryName(sentry.displayItem, true) + "\n"; } break; } #endregion #region Beds case ESPTarget.Beds: { InteractableBed bed = (InteractableBed)obj.Object; if (visual.ShowName) { text += "Bed\n"; outerText += "Bed\n"; } if (ESPOptions.ShowClaimed) { text += GetOwned(bed, true) + "\n"; outerText += GetOwned(bed, false) + "\n"; } break; } #endregion #region Claim Flags case ESPTarget.ClaimFlags: { if (visual.ShowName) text += "Claim Flag\n"; break; } #endregion #region Vehicles case ESPTarget.Vehicles: { InteractableVehicle vehicle = (InteractableVehicle)obj.Object; if (vehicle.health == 0) continue; if (ESPOptions.FilterVehicleLocked && vehicle.isLocked) continue; vehicle.getDisplayFuel(out ushort displayFuel, out ushort MaxFuel); float health = Mathf.Round(100 * (vehicle.health / (float)vehicle.asset.health)); float fuel = Mathf.Round(100 * (displayFuel / (float)MaxFuel)); if (visual.ShowName) { text += vehicle.asset.name + "\n"; outerText += vehicle.asset.name + "\n"; } if (ESPOptions.ShowVehicleHealth) { text += $"Health: {health}%\n"; outerText += $"Health: {health}%\n"; } if (ESPOptions.ShowVehicleFuel) { text += $"Fuel: {fuel}%\n"; outerText += $"Fuel: {fuel}%\n"; } if (ESPOptions.ShowVehicleLocked) { text += GetLocked(vehicle, true) + "\n"; outerText += GetLocked(vehicle, false) + "\n"; } break; } #endregion #region Storage case ESPTarget.Storage: { if (visual.ShowName) text += "Storage\n"; break; } #endregion #region Generators case ESPTarget.Generators: { InteractableGenerator gen = (InteractableGenerator)obj.Object; float fuel = Mathf.Round(100 * (gen.fuel / (float)gen.capacity)); if (ESPOptions.ShowGeneratorFuel) { text += $"Fuel: {fuel}%\n"; outerText += $"Fuel: {fuel}%\n"; } if (ESPOptions.ShowGeneratorPowered) { text += GetPowered(gen, true) + "\n"; outerText += GetPowered(gen, false) + "\n"; } break; } #endregion } if (outerText == $"<size={size}>") outerText = null; if (visual.ShowDistance) { text += $"{rounded}m\n"; if (outerText != null) outerText += $"{rounded}m\n"; } if (visual.ShowAngle) { double roundedFOV = Math.Round(VectorUtilities.GetAngleDelta(aimPos, aimForward, position), 2); text += $"Angle: {roundedFOV}°\n"; if (outerText != null) outerText += $"{roundedFOV}°\n"; } text += "</size>"; if (outerText != null) outerText += "</size>"; Vector3[] vectors = DrawUtilities.GetBoxVectors(b); Vector2[] W2SVectors = DrawUtilities.GetRectangleLines(MainCamera, b, c); Vector3 LabelVector = DrawUtilities.Get2DW2SVector(MainCamera, W2SVectors, ll); if (MirrorCameraOptions.Enabled && W2SVectors.Any(v => MirrorCameraComponent.viewport.Contains(v))) { Highlighter highlighter = go.GetComponent<Highlighter>(); if (highlighter != null) highlighter.ConstantOffImmediate(); continue; } if (visual.Boxes) { if (visual.TwoDimensional) DrawUtilities.PrepareRectangleLines(W2SVectors, c); else { DrawUtilities.PrepareBoxLines(vectors, c); LabelVector = DrawUtilities.Get3DW2SVector(MainCamera, b, ll); } } if (visual.Glow) { Highlighter highlighter = go.GetComponent<Highlighter>() ?? go.AddComponent<Highlighter>(); //highlighter.OccluderOn(); //highlighter.SeeThroughOn(); highlighter.occluder = true; highlighter.overlay = true; highlighter.ConstantOnImmediate(c); Highlighters.Add(highlighter); } else { Highlighter highlighter = go.GetComponent<Highlighter>(); if (highlighter != null && highlighter != TrajectoryComponent.Highlighted) highlighter.ConstantOffImmediate(); } if (visual.Labels) DrawUtilities.DrawLabel(ESPFont, ll, LabelVector, text, visual.CustomTextColor ? ColorUtilities.getColor($"_{obj.Target}_Text") : c, ColorUtilities.getColor($"_{obj.Target}_Outline"), visual.BorderStrength, outerText); if (visual.LineToObject) ESPVariables.DrawBuffer2.Enqueue(new ESPBox2 { Color = c, Vertices = new[] { new Vector2(Screen.width / 2, Screen.height), new Vector2(cpos.x, Screen.height - cpos.y) } }); } GLMat.SetPass(0); GL.PushMatrix(); GL.LoadProjectionMatrix(MainCamera.projectionMatrix); GL.modelview = MainCamera.worldToCameraMatrix; GL.Begin(GL.LINES); for (int i = 0; i < ESPVariables.DrawBuffer.Count; i++) { ESPBox box = ESPVariables.DrawBuffer.Dequeue(); GL.Color(box.Color); Vector3[] vertices = box.Vertices; for (int j = 0; j < vertices.Length; j++) GL.Vertex(vertices[j]); } GL.End(); GL.PopMatrix(); GL.PushMatrix(); GL.Begin(GL.LINES); for (int i = 0; i < ESPVariables.DrawBuffer2.Count; i++) { ESPBox2 box = ESPVariables.DrawBuffer2.Dequeue(); GL.Color(box.Color); Vector2[] vertices = box.Vertices; bool Run = true; for (int j = 0; j < vertices.Length; j++) if (j < vertices.Length - 1) { Vector2 v1 = vertices[j]; Vector2 v2 = vertices[j + 1]; if (Vector2.Distance(v2, v1) > Screen.width / 2) { Run = false; break; } } if (!Run) continue; for (int j = 0; j < vertices.Length; j++) GL.Vertex3(vertices[j].x, vertices[j].y, 0); } GL.End(); GL.PopMatrix(); }
public void HighlightOn(Color color) { UpdateHighlighter(); h.ConstantOnImmediate(color); }
void OnGUI() { if (_menuVisible) { _menuRect = GUI.Window(1337, _menuRect, MenuFunction, "TABG Hax"); if (_itemMenuVisible) { _itemMenuRect = GUI.Window(1338, _itemMenuRect, ItemMenuFunction, "Items"); } } if (_ESP) { if (_distanceESP) { foreach (Player player in _players) { if (!IsValid(player)) { _players.Remove(player); continue; } Hip hip = player.m_hip; // Check for dead player & local player if (player.gameObject != Player.localPlayer.gameObject) { Highlighter highlighter = player.transform.EDEAKJBKLIC <Highlighter>(); highlighter.FlashingOff(); highlighter.ConstantOnImmediate(Color.red); // Get screen point Vector3 pos = Camera.main.WorldToScreenPoint(hip.transform.position); pos.y = Screen.height - pos.y; // Make sure it is on screen if (pos.z > 0f) { GUI.Label(new Rect(pos.x, pos.y, 50, 20), Vector3.Distance(hip.transform.position, Camera.main.transform.position).ToString()); } } } } if (_itemESP) { foreach (Pickup item in _items) //PickupManager.instance.m_Pickups) { if (!IsValid(item)) { _items.Remove(item); continue; } Vector3 pos = Camera.main.WorldToScreenPoint(item.transform.position); pos.y = Screen.height - pos.y; if (pos.z > 0f) { GUI.Label(new Rect(pos.x, pos.y, 100, 20), item.name); } } } } //Launch in Direction if (Input.GetKeyDown(KeyCode.F1)) { Skydiving dive = Player.localPlayer.gameObject.GetComponent <Skydiving>(); if (dive == null) { Player.localPlayer.gameObject.AddComponent <Skydiving>(); } dive.Launch(Player.localPlayer.m_playerCamera.transform.forward * 0.5f); } //Aimbot if (Input.GetKeyDown(KeyCode.F2)) { var playerDeaths = FindObjectsOfType <PlayerDeath>(); float lowestDist = 1000; GameObject bestPlayer = null; foreach (PlayerDeath playerDeath in playerDeaths) { // Check for dead player & local player if (!playerDeath.dead && playerDeath.gameObject != Player.localPlayer.gameObject) { float dist = Vector3.Distance(Player.localPlayer.transform.position, playerDeath.gameObject.transform.position); if (dist < lowestDist) { lowestDist = dist; bestPlayer = playerDeath.gameObject; } } } if (bestPlayer != null) { Head head = bestPlayer.GetComponentInChildren <Head>(); Player.localPlayer.m_playerCamera.transform.LookAt(head.transform.position); } } }
// Highlighting public void HighlightOn(Color color) { h.ConstantOnImmediate(color); }
public void Ready() { Color col = new Color(0.2f, 0.2f, 0.8f, 1f); h.ConstantOnImmediate(col); }
// public void Shine() { h.FlashingOff(); h.ConstantOnImmediate(Color.cyan); h.ConstantOff(); }
public void HighlightOn() { h.ConstantOnImmediate(Color.yellow); }