วิธีการสมัครใช้บริการเสียง

subscribe(
  callback: (isEnabled: boolean) => void
): void

ติดตามการเปลี่ยนแปลง isEnabled จะถูกเรียก callback ด้วยค่าของ isEnabled เมื่อมีการเปลี่ยนแปลง

ตัวอย่าง

engine.sound.setMute(!GameSnacks.audio.isEnabled);
GameSnacks.audio.subscribe((isEnabled) => engine.sound.setMute(!isEnabled));

ข้อกำหนด

โปรดดู isEnabled