Esempio n. 1
0
        public void Draw3DBox(Vector3 center, Vector3 min, Vector3 max, Quaternion rot, Color c)
        {
            Vector3 point  = new Vector3(min.x, max.y, min.z);
            Vector3 point2 = new Vector3(max.x, max.y, min.z);
            Vector3 point3 = new Vector3(min.x, max.y, max.z);
            Vector3 point4 = new Vector3(min.x, min.y, max.z);
            Vector3 point5 = new Vector3(max.x, min.y, min.z);
            Vector3 point6 = new Vector3(max.x, min.y, max.z);

            min = RotateAroundPoint(min, center, rot);
            max = RotateAroundPoint(max, center, rot);
            Vector3 position  = RotateAroundPoint(point, center, rot);
            Vector3 position2 = RotateAroundPoint(point2, center, rot);
            Vector3 position3 = RotateAroundPoint(point3, center, rot);
            Vector3 position4 = RotateAroundPoint(point4, center, rot);
            Vector3 position5 = RotateAroundPoint(point5, center, rot);
            Vector3 position6 = RotateAroundPoint(point6, center, rot);
            Vector3 vector    = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(min);
            Vector3 vector2   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(max);
            Vector3 vector3   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(position);
            Vector3 vector4   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(position2);
            Vector3 vector5   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(position3);
            Vector3 vector6   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(position4);
            Vector3 vector7   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(position5);
            Vector3 vector8   = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(position6);

            if ((double)vector.z <= 0.0 || (double)vector2.z <= 0.0 || (double)vector3.z <= 0.0 || (double)vector4.z <= 0.0 || (double)vector5.z <= 0.0 || (double)vector6.z <= 0.0 || (double)vector7.z <= 0.0 || (double)vector8.z <= 0.0)
            {
                return;
            }
            Vector3 vector9 = GUIUtility.ScreenToGUIPoint(vector);

            vector9.y = (float)Screen.height - vector9.y;
            Vector3 vector10 = GUIUtility.ScreenToGUIPoint(vector2);

            vector10.y = (float)Screen.height - vector10.y;
            Vector3 vector11 = GUIUtility.ScreenToGUIPoint(vector3);

            vector11.y = (float)Screen.height - vector11.y;
            Vector3 vector12 = GUIUtility.ScreenToGUIPoint(vector4);

            vector12.y = (float)Screen.height - vector12.y;
            Vector3 vector13 = GUIUtility.ScreenToGUIPoint(vector5);

            vector13.y = (float)Screen.height - vector13.y;
            Vector3 vector14 = GUIUtility.ScreenToGUIPoint(vector6);

            vector14.y = (float)Screen.height - vector14.y;
            Vector3 vector15 = GUIUtility.ScreenToGUIPoint(vector7);

            vector15.y = (float)Screen.height - vector15.y;
            Vector3 vector16 = GUIUtility.ScreenToGUIPoint(vector8);

            vector16.y = (float)Screen.height - vector16.y;
            GUIHelper.DrawLine(vector9, vector15, c);
            GUIHelper.DrawLine(vector9, vector14, c);
            GUIHelper.DrawLine(vector16, vector15, c);
            GUIHelper.DrawLine(vector16, vector14, c);
            GUIHelper.DrawLine(vector11, vector12, c);
            GUIHelper.DrawLine(vector11, vector13, c);
            GUIHelper.DrawLine(vector10, vector12, c);
            GUIHelper.DrawLine(vector10, vector13, c);
            GUIHelper.DrawLine(vector9, vector11, c);
            GUIHelper.DrawLine(vector14, vector13, c);
            GUIHelper.DrawLine(vector15, vector12, c);
            GUIHelper.DrawLine(vector16, vector10, c);
        }
Esempio n. 2
0
        public void Update()
        {
            #region Debugger UI
            if (Input.GetKey(KeyCode.Escape) && Input.GetKeyDown(KeyCode.Return))
            {
                GuiConsole.toggleGuiConsole = !GuiConsole.toggleGuiConsole;
                string Notify = GuiConsole.toggleGuiConsole ? "Debugger UI Enabled." : "Debugger UI Disabled.";
                ConsoleUtils.Info(Notify);
            }
            #endregion

            #region Keybinds
            if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.Y))
            {
                GeneralUtils.Swap("avtr_56674e13-8e5f-4eae-be53-21980ec4e965");
            }

            if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.C))
            {
                GeneralUtils.Swap("avtr_c38a1615-5bf5-42b4-84eb-a8b6c37cbd11");
            }

            if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.F))
            {
                GeneralUtils.Flight = !GeneralUtils.Flight;
                Physics.gravity     = GeneralUtils.Flight ? Vector3.zero : GeneralUtils.Grav;
            }
            #endregion

            #region HeadFlipper
            if (GeneralUtils.HeadFlipper)
            {
                VRCVrCamera.GetInstance().GetComponentInChildren <NeckMouseRotator>().rotationRange.x = float.MinValue;
                VRCVrCamera.GetInstance().GetComponentInChildren <NeckMouseRotator>().rotationRange.z = float.MaxValue;
            }
            #endregion

            #region SpinBot
            if (GeneralUtils.SpinBot)
            {
                //VRCPlayer.Instance.gameObject.transform.position = GeneralUtils.Vector;
                VRCPlayer.Instance.gameObject.transform.Rotate(0f, 20f, 0f);
            }
            #endregion

            #region Send Messages
            if (Event.current.shift && Input.GetKeyDown(KeyCode.F))
            {
                if (!VRCTrackingManager.IsInVRMode())
                {
                    //Funeral Message Sending
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine("Enter message:");
                    var msg = Console.ReadLine();
                    Console.WriteLine("Enter Receiver User ID:");
                    string userid       = Console.ReadLine();
                    var    author       = VRCPlayer.Instance.LIPBCOFIIHI.GetAPIUser().displayName;
                    var    authorUserId = VRCPlayer.Instance.LIPBCOFIIHI.GetAPIUser().id;
                    var    date         = DateTime.UtcNow.Date.ToShortDateString();
                    base.StartCoroutine(SendFMessage(author, authorUserId, msg, userid, date));
                }
            }
            #endregion

            #region Send Normal Messages
            if (Event.current.shift && Input.GetKeyDown(KeyCode.M))
            {
                if (!VRCTrackingManager.IsInVRMode())
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine("Enter message:");
                    var message = Console.ReadLine();
                    Console.WriteLine("Enter ReceiverUserID: ");
                    var user = Console.ReadLine();
                    Console.WriteLine("Sending message...");
                    NotificationDetails notificationDetails = new NotificationDetails();
                    notificationDetails["worldId"]   = RoomManager.currentRoom.id + ":" + RoomManagerBase.currentRoom.currentInstanceIdWithTags;
                    notificationDetails["worldName"] = $"\n{VRCPlayer.Instance.LIPBCOFIIHI.GetAPIUser().displayName} said:\n" + message;
                    Resources.FindObjectsOfTypeAll <NotificationManager>()[0].SendNotification(user, "invite", string.Empty, notificationDetails);
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("Message sent.");
                    Console.ForegroundColor = ConsoleColor.White;
                }
            }
            #endregion

            #region Force Mute
            PlayerManager.GetAllPlayers().ToList().ForEach(X =>
            {
                if (GeneralUtils.Deafened.Contains(X.GetAPIUser().id))
                {
                    X.vrcPlayer.canHear = false;
                }
                else if (GeneralUtils.DeafenNonFriends)
                {
                    if (!X.IsFriended())
                    {
                        X.vrcPlayer.canHear = false;
                    }
                }
                else
                {
                    X.vrcPlayer.canHear = true;
                }
            });
            #endregion

            #region ForceKick Check
            if (GeneralUtils.ForceKickRequest)
            {
                if (GeneralUtils.ForceKickString != null)
                {
                    var user  = GeneralUtils.ForceKickString.ToString().Split(' ')[0];
                    var world = GeneralUtils.ForceKickString.ToString().Split(' ')[1];
                    base.StartCoroutine(SendForceKickRequest(user, world));
                    GeneralUtils.ForceKickRequest = false;
                    GeneralUtils.ForceKickString  = null;
                }
            }
            #endregion

            #region SpinBot Disabler
            if (Event.current.alt && Input.GetKeyDown(KeyCode.S))
            {
                GeneralUtils.SpinBot = !GeneralUtils.SpinBot;
            }
            #endregion

            #region Freeze Keybind
            if (Event.current.alt && Input.GetKey(KeyCode.F))
            {
                GeneralUtils.Searialise = !GeneralUtils.Searialise;
            }
            #endregion
        }