/// <summary> /// 获取声音接收器 /// </summary> public static VoiceReceiver Get(string name) { VoiceReceiver result = null; for (int i = 0; i < Count; i++) { VoiceReceiver voiceReceiver = Get(i); if (voiceReceiver != null && voiceReceiver.Name == name) { result = voiceReceiver; break; } } return(result); }
/// <summary> /// 获取声音接收器 /// </summary> public static VoiceReceiver Get(int index) { VoiceReceiver result = null; _voiceReceiverDic?.TryGetValue(index, out result); if (result == null) { result = new VoiceReceiver(index); if (_voiceReceiverDic != null) { _voiceReceiverDic[index] = result; } } return(result); }