void OnDeath_proxy(int uid) { if (OnDeath != null) { VRPlayer player = playerManager.GetPlayer(uid); OnDeath(player); } }
/// <summary> /// Adds the player. /// </summary> /// <param name="player">Player.</param> /// <param name="isCurrent">If set to <c>true</c> is current.</param> public void AddPlayer(VRPlayer player, bool isCurrent = false) { if (player.uid > 0) { m_PlayerList.Add(player.uid, player); if (isCurrent) { this.CurrentPlayer = player; } } }
private IEnumerator ReportCurrentPosition() { while (true) { yield return(new WaitForSeconds(0.3f)); // wait half a second VRPlayer p = playerManager.CurrentPlayer; if (p != null) { vrConnect.SendCurrentPosition(p.Move.x, p.Move.y, p.Move.z, p.Rotation.x, p.Rotation.y, p.Rotation.z, p.Position.x, p.Position.y, p.Position.z); } } }
void OnSoldOut_proxy(int uid, int unitnum) { if (OnSoldOut != null) { VRPlayer player = playerManager.GetPlayer(uid); UnitType type = (UnitType)unitnum; OnSoldOut(player, type); } if (playerManager.CurrentPlayer.uid == uid) { UnitType type = (UnitType)unitnum; playerManager.CurrentPlayer.Unit = type; } }
/// <summary> /// Gets the type of the player from unit. /// </summary> /// <returns>The player from unit type.</returns> /// <param name="type">Type.</param> public VRPlayer GetPlayerFromUnitType(UnitType type) { VRPlayer player = null; foreach (VRPlayer p in m_PlayerList.Values) { if (p.Unit == type) { player = p; break; } } return(player); }
public void SendHit(VRPlayer player) { vrConnect.SendHit(player.uid); }
/// <summary> /// Gets the player. /// </summary> /// <returns>The player.</returns> /// <param name="uid">Uid.</param> public VRPlayer GetPlayer(int uid) { VRPlayer player = m_PlayerList [uid]; return(player); }