/// <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); } }
/// <summary> /// 移除角色 /// </summary> /// <param name="id">角色ID.</param> public void Remove(uint id) { L_Player player = Find(id); if (player != null) { m_Players.Remove(player); } }
/// <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); }
/// <summary> /// 添加角色 /// </summary> /// <param name="actor">Actor.</param> public uint Add(L_Player player) { m_Players.Add(player); return((uint)m_Players.Count); }
/// <summary> /// 添加角色 /// </summary> /// <param name="actor">Actor.</param> public uint Add(L_Player player) { m_IDCounter++; m_Players.Add(player); return(m_IDCounter); }