Esempio n. 1
0
 void OnDeath_proxy(int uid)
 {
     if (OnDeath != null)
     {
         VRPlayer player = playerManager.GetPlayer(uid);
         OnDeath(player);
     }
 }
Esempio n. 2
0
        /// <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;
                }
            }
        }
Esempio n. 3
0
        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);
                }
            }
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
        /// <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);
        }
Esempio n. 6
0
 public void SendHit(VRPlayer player)
 {
     vrConnect.SendHit(player.uid);
 }
Esempio n. 7
0
        /// <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);
        }