Exemplo n.º 1
0
 public static void Menu()
 {
     if (GUI.Button(new Rect(670f, 20f, 130f, 30f), string.Format("Mod Menu is {0}", ModMenu.showMenu ? "ON" : "OFF"), ModMenu.BtnStyle))
     {
         ModMenu.showMenu = !ModMenu.showMenu;
     }
     if (ModMenu.showMenu)
     {
         Cursor.lockState    = CursorLockMode.None;
         Cursor.visible      = true;
         ModMenu.windowRect0 = GUI.Window(0, ModMenu.windowRect0, new GUI.WindowFunction(ModMenu.WindowFunction), "Modz");
         return;
     }
     if (ModMenu.esp)
     {
         Collider[] array = Physics.OverlapSphere(UnitySingletonBehavior <GameState> .Instance.PlayerManager.transform.position, 100f, LayerUtils.MonsterLayerMask);
         for (int i = 0; i < array.Length; i++)
         {
             VisualActorMonster componentInParent = array[i].GetComponentInParent <VisualActorMonster>();
             if (!(componentInParent == null))
             {
                 RemoteEntityMonster remoteEntityMonster = componentInParent.GetEntity() as RemoteEntityMonster;
                 if (remoteEntityMonster != null && !remoteEntityMonster.IsDead)
                 {
                     Vector3 position = remoteEntityMonster.Position;
                     Vector3 vector   = Camera.main.WorldToScreenPoint(position);
                     if (vector.z > 0f && ModMenu.IsInScreen(position))
                     {
                         Vector3 v2 = GUIUtility.ScreenToGUIPoint(vector);
                         v2.y = (float)Screen.height - v2.y;
                         ModMenu.RenderLines(new Vector2((float)(Screen.width / 2), (float)Screen.height), v2, Color.cyan);
                         GUI.Label(new Rect(vector.x, (float)Screen.height - vector.y, 120f, 120f), string.Concat(new object[]
                         {
                             remoteEntityMonster.DisplayName,
                             "\nCurrent Health: ",
                             remoteEntityMonster.Health.ToString(),
                             "\nMax Health: ",
                             remoteEntityMonster.HealthMax.ToString(),
                             "\nID:",
                             remoteEntityMonster.Id.ToString()
                         }), new GUIStyle
                         {
                             fontSize  = 13,
                             fontStyle = FontStyle.Bold,
                             normal    =
                             {
                                 textColor = Color.red
                             }
                         });
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 private static void RenderLines(Vector2 pointA, Vector2 pointB, Color color)
 {
     if (ModMenu.GetLineMaterial() != null)
     {
         ModMenu.GetLineMaterial().SetPass(0);
         GL.Begin(1);
         GL.Color(color);
         GL.Vertex3(pointA.x, pointA.y, 0f);
         GL.Vertex3(pointB.x, pointB.y, 0f);
         GL.End();
     }
 }