public void ClearLog(EMLogLevel logLevel)
 {
     foreach (var member in poolLogItem)
     {
         if (member.bActive && member.member.logLevel == logLevel)
         {
             poolLogItem.RecycleMember(member.member);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// 私有,创建audioPlayer时注册事件,需要注销在audioplayer调用destroy
        /// </summary>
        /// <param name="player"></param>
        private void RemoveAudioPlayer(AudioPlayer player)
        {
            if (player == null)
            {
                return;
            }

            //移除player脚本
            listActivePlayer.Remove(player);

            if (player.audioSource != null)
            {
                //清空clip
                player.audioSource.clip = null;
                //播放器添加进堆
                poolAudioSource.RecycleMember(player.audioSource);
            }

            //结束事件
            EventPlayAudioEnd?.Invoke(player?.audioSource?.clip);
        }