public static float DistanceTo(Player player) { Hip pHip = player.GetComponentInChildren <Hip>(); if (!pHip) { return(Vector3.Distance(GetLocalPlayer().GetPosition(), player.transform.position)); } return(Vector3.Distance(GetLocalPlayer().GetPosition(), player.GetComponentInChildren <Hip>().transform.position)); }
private void Number_reg_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) { try { if (!(Regex.IsMatch(Height.Text, @"^\d*$"))) { Height.Clear(); throw new Exception("Error!!! Неправильные символы"); } else if (!(Regex.IsMatch(Weight.Text, @"^\d*$"))) { Weight.Clear(); throw new Exception("Error!!! Неправильные символы"); } else if (!(Regex.IsMatch(Arms.Text, @"^\d*$"))) { Arms.Clear(); throw new Exception("Error!!! Неправильные символы"); } else if (!(Regex.IsMatch(Waist.Text, @"^\d*$"))) { Waist.Clear(); throw new Exception("Error!!! Неправильные символы"); } else if (!(Regex.IsMatch(Chest.Text, @"^\d*$"))) { Chest.Clear(); throw new Exception("Error!!! Неправильные символы"); } else if (!(Regex.IsMatch(Leg.Text, @"^\d*$"))) { Leg.Clear(); throw new Exception("Error!!! Неправильные символы"); } else if (!(Regex.IsMatch(Hip.Text, @"^\d*$"))) { Hip.Clear(); throw new Exception("Error!!! Неправильные символы"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public override bool Set(IModalityAccessor other) { var o = other as LegModalityAccessor; if (o == null)//|| o.Side != Side && (o.Side != SideType.None && Side != SideType.None))//constraint on the side { return(false); } Enabled = o.Enabled; if (!Enabled) { return(true); } Hip.Set(o.Hip); knee.Set(o.knee); foot.Set(o.foot); return(true); }
public void Add(Gait gait) { if (Counter == XSize) { Clear(); Counter = 0; } else { Counter++; } Ankle.AngularValues.Points.Add(new DataPoint(Counter, gait.CurrentAnkleFlexion)); Knee.AngularValues.Points.Add(new DataPoint(Counter, gait.CurrentKneeFlexion)); Hip.AngularValues.Points.Add(new DataPoint(Counter, gait.CurrentHipFlexion)); Ankle.UpdateMinMax(gait.CurrentAnkleFlexion); Knee.UpdateMinMax(gait.CurrentKneeFlexion); Hip.UpdateMinMax(gait.CurrentHipFlexion); }
public Trunk(Shoulder shoulder, Hip hip) { _robotParts = new IRobotPart[] { shoulder, hip }; }
public Trunk() { Hip = new Hip(); Shoulder = new Shoulder(); }
void InitObject() { lineRenderer1 = (LineRenderer)RFoot.GetComponent <LineRenderer>(); lineRenderer2 = (LineRenderer)LWrist.GetComponent <LineRenderer>(); lineRenderer3 = (LineRenderer)Hip.GetComponent <LineRenderer>(); }
IEnumerator StartWithIsNetworkFalse() { yield return(new WaitForSecondsRealtime(1.0f)); if (this.player != null) { GameObject.DestroyImmediate(this.player); this.player = null; } mgr.GameHasStartForMap = true; // play count down if (mgr.latestLoadedMapInfo.CurrentSerializeMap != null && mgr.latestLoadedMapInfo.CurrentSerializeMap.MapInfoMode == (int)MapGameMode.Parkour) { if (UICountDownGo.ins != null) { UICountDownGo.ins.Play(); } } else { if (UICountDown.ins != null) { UICountDown.ins.Play(); } } // yield return new WaitForSecondsRealtime(1.5f); //create player automatic var obj = MiscLoader.ins.LoadAndInstantiate <GameObject>("Game/Character", "Game/Character/Character.prefab"); this.player = obj; obj.SetActive(true); // yield return new WaitForEndOfFrame(); obj.layer = 20; foreach (var p in obj.GetComponentsInChildren <Collider>(true)) { p.gameObject.layer = 20; } var info = obj.GetComponent <CharacterInformation>(); if (info != null) { foreach (var p in obj.GetComponentsInChildren <SetLinePositions>()) { p.SetColor(info.myColor); } obj.GetComponentInChildren <HeadRenderer>().SetColor(info.myColor, info.id_in_room); // var sync = obj.GetComponent<SyncablePlayer>(); // GameObject.DestroyObject(sync as Component); info.myLayer = 20; info.uuid = StaticData.uuid; info.luuid = StaticData.luuid; info.characterName = PlayerPrefs.GetString("PlayerName"); info.teamID = PlayerPrefs.GetInt("teamid"); } else { foreach (var p in obj.GetComponentsInChildren <SetLinePositions>()) { p.SetColor(new Color(230f / 255f, 190f / 255f, 0f / 255f)); } obj.GetComponentInChildren <HeadRenderer>().SetColor(new Color(230f / 255f, 190f / 255f, 0f / 255f)); // var sync = obj.GetComponent<SyncablePlayer>(); // GameObject.DestroyObject(sync as Component); } var controller = obj.GetComponent <Controller>(); controller.TakeLocalControl(); if (mgr != null) { mgr.mPlayersAll.Add(controller); } //set player position Vector3 target = mgr.latestLoadedMapInfo.spawnPoints[UnityEngine.Random.Range(0, mgr.latestLoadedMapInfo.spawnPoints.Length)].position; var rigs = obj.GetComponentsInChildren <Rigidbody>(); Hip hip = obj.GetComponentInChildren <Hip>(true); var delta = target - hip.transform.position; // obj.transform.position = target; foreach (var pp in rigs) { if (pp == null) { continue; //TODO when player remove this coroutine will missing reference } pp.transform.position += delta; } AddSkinToCharacter(this.player); //TODO why this code do not work ? foreach (Rigidbody rig in rigs) { rig.isKinematic = true;// disable physics } yield return(new WaitForEndOfFrame()); yield return(new WaitForSecondsRealtime(1f)); foreach (Rigidbody rig in rigs) { rig.isKinematic = false;// disable physics } }
public void SetUp() { _target = new Hip(); }
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); } } }