$(document).ready(function(){ function isSmartPhone (){ if ((navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0) { return true; } return false; } $(".hogehoge").on( "click", function() { if(isSmartPhone() == true) { // スマホ. Unity.call( "hogehoge"); } else { // Unityエディタ(Mac