Exemplo n.º 1
0
 public static void Mobs()
 {
     for (int i = 0; i < hurtBoxes.Count; i++)
     {
         var mob = HurtBox.FindEntityObject(hurtBoxes[i]);
         if (mob)
         {
             Vector3 MobPosition       = Camera.main.WorldToScreenPoint(mob.transform.position);
             var     MobBoundingVector = new Vector3(MobPosition.x, MobPosition.y, MobPosition.z);
             float   distanceToMob     = Vector3.Distance(Camera.main.transform.position, mob.transform.position);
             if (MobBoundingVector.z > 0.01)
             {
                 float width = 100f * (distanceToMob / 100);
                 if (width > 125)
                 {
                     width = 125;
                 }
                 float height = 100f * (distanceToMob / 100);
                 if (height > 125)
                 {
                     height = 125;
                 }
                 string mobName     = mob.name.Replace("Body(Clone)", "");
                 int    mobDistance = (int)distanceToMob;
                 string mobBoxText  = $"{mobName}\n{mobDistance}m";
                 GUI.Label(new Rect(MobBoundingVector.x - 50f, (float)Screen.height - MobBoundingVector.y + 50f, 100f, 50f), mobBoxText, Styles.RenderMobsStyle);
                 ESPHelper.DrawBox(MobBoundingVector.x - width / 2, (float)Screen.height - MobBoundingVector.y - height / 2, width, height, new Color32(255, 0, 0, 255));
             }
         }
     }
 }
Exemplo n.º 2
0
        public static void RenderClosestChest()
        {
            var     chest               = FindClosestChest();
            Vector3 chestPosition       = Camera.main.WorldToScreenPoint(chest.transform.position);
            var     chestBoundingVector = new Vector3(chestPosition.x, chestPosition.y, chestPosition.z);

            if (chestBoundingVector.z > 0.01)
            {
                string dropNameColored = Util.GenerateColoredString(Language.GetString(chest.GetField <PickupIndex>("dropPickup").GetPickupNameToken()), chest.GetField <PickupIndex>("dropPickup").GetPickupColor());
                float  distanceToChest = Vector3.Distance(Camera.main.transform.position, FindClosestChest().transform.position);
                float  width           = 100f * (distanceToChest / 100);
                if (width > 125)
                {
                    width = 125;
                }
                float height = 100f * (distanceToChest / 100);
                if (height > 125)
                {
                    height = 125;
                }

                if (Render.renderInteractables)
                {
                    GUI.Label(new Rect(chestBoundingVector.x - 50f, (float)Screen.height - chestBoundingVector.y + 35f, 100f, 50f), $"Selected Chest", Styles.SelectedChestStyle);
                }
                else
                {
                    GUI.Label(new Rect(chestBoundingVector.x - 50f, (float)Screen.height - chestBoundingVector.y + 35f, 100f, 50f), $"Selected Chest\n{dropNameColored}", Styles.SelectedChestStyle);
                }
                ESPHelper.DrawBox(chestBoundingVector.x - width / 2, (float)Screen.height - chestBoundingVector.y - height / 2, width, height, new Color32(17, 204, 238, 255));
            }
        }