Ejemplo n.º 1
0
 /// <summary>
 /// 清除所有角色
 /// </summary>
 public void Clear()
 {
     for (int i = m_Players.Count - 1; i >= 0; i--)
     {
         L_Player player = m_Players[i];
         GameObject.Destroy(player.gameObject);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 移除角色
        /// </summary>
        /// <param name="id">角色ID.</param>
        public void Remove(uint id)
        {
            L_Player player = Find(id);

            if (player != null)
            {
                m_Players.Remove(player);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查找角色
        /// </summary>
        /// <param name="id">角色ID</param>
        public L_Player Find(uint id)
        {
            L_Player player = null;

            for (int i = 0; i < m_Players.Count; i++)
            {
                player = m_Players[i];
                if (player.UserID == id)
                {
                    break;
                }
            }
            return(player);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 添加角色
 /// </summary>
 /// <param name="actor">Actor.</param>
 public uint Add(L_Player player)
 {
     m_Players.Add(player);
     return((uint)m_Players.Count);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 添加角色
 /// </summary>
 /// <param name="actor">Actor.</param>
 public uint Add(L_Player player)
 {
     m_IDCounter++;
     m_Players.Add(player);
     return(m_IDCounter);
 }