| | |
| | | // 如果池为空,检查是否可以动态创建 |
| | | if (audioSourceObject == null) |
| | | { |
| | | BattleDebug.LogErrorError("BattleSoundManager: audioSourceObject 为空,无法创建 AudioSource"); |
| | | BattleDebug.LogError("BattleSoundManager: audioSourceObject 为空,无法创建 AudioSource"); |
| | | return null; |
| | | } |
| | | |
| | |
| | | if (totalAudioSources >= MAX_AUDIO_SOURCES) |
| | | { |
| | | // 达到上限,不再创建,丢弃这次播放请求 |
| | | BattleDebug.LogErrorWarning($"BattleSoundManager: AudioSource 数量已达上限 {MAX_AUDIO_SOURCES},无法播放新音效"); |
| | | BattleDebug.LogError($"BattleSoundManager: AudioSource 数量已达上限 {MAX_AUDIO_SOURCES},无法播放新音效"); |
| | | return null; |
| | | } |
| | | |