Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.42 KB | None | 0 0
  1.     static function unlockSound(): Void {
  2.         if (!soundEnabled) {
  3.             var context = kha.audio2.Audio._context;
  4.  
  5.             if (context == null) {
  6.                 context = untyped __js__('kha_audio2_Audio1._context');
  7.             }
  8.  
  9.             if (context != null) {
  10.                 context.resume().then(function (c) {
  11.                     soundEnabled = true;
  12.                     // trace('sound enabled');
  13.                 }).catchError(function( err ) {
  14.                     trace(err);
  15.                 });
  16.             }
  17.         }
  18.         unlockiOSSound();
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement