Initial flame_lua_runtime package
This commit is contained in:
27
lib/runtime/audio/runtime_audio_debug.dart
Normal file
27
lib/runtime/audio/runtime_audio_debug.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
part of 'runtime_audio_manager.dart';
|
||||
|
||||
extension _RuntimeAudioManagerDebug on RuntimeAudioManager {
|
||||
Map<String, Object?> _audioRecordDebugJson({
|
||||
required String? key,
|
||||
required String path,
|
||||
required String? preload,
|
||||
required bool declared,
|
||||
}) {
|
||||
final record = _audios[path];
|
||||
return {
|
||||
if (key != null) 'key': key,
|
||||
'path': path,
|
||||
'type': GameResourceType.audio,
|
||||
'declared': declared,
|
||||
if (preload != null) 'preload': preload,
|
||||
if (key != null && _package?.manifest.resources[key]?.group != null)
|
||||
'group': _package?.manifest.resources[key]?.group,
|
||||
'state': (record?.state ?? GameResourceState.idle).name,
|
||||
if (record != null) 'generation': record.generation,
|
||||
'loading': record?.inflight != null,
|
||||
'ready': record?.bytes != null,
|
||||
if (record?.bytes != null) 'bytes': record!.bytes!.length,
|
||||
if (record?.lastError != null) 'error': record!.lastError.toString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user