ArkanoidTG/Assets/Plugins/WebGL/HapticsPlugin.jslib

21 lines
494 B
Plaintext
Raw Permalink Normal View History

2024-11-25 23:14:57 +03:00
var HapticsPlugin = {
HapticFeedback: function(duration) {
try {
if (navigator.vibrate) {
navigator.vibrate(duration);
return true;
}
return false;
} catch(e) {
console.error('Haptic feedback error:', e);
return false;
}
},
IsHapticSupported: function() {
return (navigator.vibrate) ? 1 : 0;
}
};
mergeInto(LibraryManager.library, HapticsPlugin);