Пример #1
0
 private void FrameIncrease(string[] frames, MultiplayerPlayerScript clients)
 {
     if (delayTimer.TimePassed(delay.GetValueFloat() / 100))
     {
         delayTimer.Reset();
         clients.Networkplayername = frames[frameCounter];
         clients.Networkplainname  = frames[frameCounter];
         frameCounter++;
     }
 }
Пример #2
0
 public override void OnUpdate()
 {
     myMouseLook = (MyMouseLook)GameObject.Find("MainCamera").GetComponent(typeof(MyMouseLook));
     target      = GetTarget();
     if (target)
     {
         if ((Input.GetKey(KeyCode.Mouse0) && mouse.Selected == "LEFT") ||
             (Input.GetKey(KeyCode.Mouse1) && mouse.Selected == "RIGHT"))
         {
             myMouseLook.transform.LookAt(target.transform.position);
         }
     }
 }
Пример #3
0
 private void DrawWindow(int windowID)
 {
     scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(windowRect.width - 15), GUILayout.Height(windowRect.height - 15));
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     if (target == null)
     {
         GUILayout.Label("Players:", new GUILayoutOption[0]);
         foreach (MultiplayerPlayerScript players in multiplayerPlayerScript)
         {
             if (players != null)
             {
                 if (GUILayout.Button(players.playername, new GUILayoutOption[0]))
                 {
                     target = players;
                 }
             }
         }
     }
     else
     {
         GUILayout.Label(target.playername, new GUILayoutOption[0]);
         //Name
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         newName = GUILayout.TextField(newName, new GUILayoutOption[0]);
         if (GUILayout.Button("Apply", new GUILayoutOption[0]))
         {
             //target.plainname = newName;
             //target.playername = newName;
             //target.username = newName;
             target.CmdSetName(newName, newName);
         }
         GUILayout.EndHorizontal();
         //Kills
         GUILayout.Label("Kills:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         newKills = Int32.Parse(GUILayout.TextField(newKills.ToString(), new GUILayoutOption[0]));
         if (GUILayout.Button("Apply", new GUILayoutOption[0]))
         {
             target.kills = newKills;
         }
         GUILayout.EndHorizontal();
         //Deaths
         GUILayout.Label("Deaths:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         newDeaths = Int32.Parse(GUILayout.TextField(newDeaths.ToString(), new GUILayoutOption[0]));
         if (GUILayout.Button("Apply", new GUILayoutOption[0]))
         {
             target.deaths = newDeaths;
         }
         GUILayout.EndHorizontal();
         //TP To
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         if (GUILayout.Button("TeleportTo", new GUILayoutOption[0]))
         {
             if (Main.ModuleManager.IsModuleActive(Main.ModuleManager.GetModule("NoClip")))
             {
                 NoClip.PlayerPos = target.transform.position;
             }
             else
             {
                 ((MyControllerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MyControllerScript)))[0]
                 .transform.position = target.transform.position;
             }
         }
         if (GUILayout.Button("TeleportThem", new GUILayoutOption[0]))
         {
             target.transform.position = ((MyControllerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MyControllerScript)))[0]
                                         .transform.position;
         }
         GUILayout.EndHorizontal();
         if (!godModeList.Contains(target))
         {
             if (GUILayout.Button("GiveGodMode", new GUILayoutOption[0]))
             {
                 godModeList.Add(target);
             }
         }
         else
         {
             if (GUILayout.Button("RemoveGodMode", new GUILayoutOption[0]))
             {
                 godModeList.Remove(target);
             }
         }
         GUILayout.Label("Health:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         //Health
         newHealth = Int32.Parse(GUILayout.TextField(newHealth.ToString(), new GUILayoutOption[0]));
         if (GUILayout.Button("Apply", new GUILayoutOption[0]))
         {
             target.myhealth = newHealth;
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Armour:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         //Armour
         newArmour = Int32.Parse(GUILayout.TextField(newArmour.ToString(), new GUILayoutOption[0]));
         if (GUILayout.Button("Apply", new GUILayoutOption[0]))
         {
             target.myarmor = newArmour;
         }
         GUILayout.EndHorizontal();
         if (GUILayout.Button("Kick", new GUILayoutOption[0]))
         {
             target.kickbool = true;
         }
         if (GUILayout.Button("Done", new GUILayoutOption[0]))
         {
             target = null;
         }
     }
     GUILayout.EndVertical();
     GUILayout.EndScrollView();
     GUI.DragWindow(new Rect(0, 0, 1000, 1000));
 }