-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing if this fixed the auto build
- Loading branch information
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
mergeInto(LibraryManager.library, { | ||
AutoCursorLock: function () { | ||
window.OnCursorStateChanged = function OnCursorStateChanged() | ||
{ | ||
var unityCanvas = document.getElementById("unity-canvas"); | ||
if (document.pointerLockElement != unityCanvas && document.mozPointerLockElement != unityCanvas) { | ||
unityInstance.SendMessage("CameraModeChanger", "GodViewMode"); | ||
} | ||
} | ||
//Cursor locking for First Person camera mode | ||
if ("onpointerlockchange" in document) { | ||
document.addEventListener('pointerlockchange', window.OnCursorStateChanged, false); | ||
console.log(document.pointerLockElement); | ||
} | ||
else if ("onmozpointerlockchange" in document) { | ||
document.addEventListener('mozpointerlockchange', window.OnCursorStateChanged, false); | ||
console.log(document.mozPointerLockElement); | ||
} | ||
}, | ||
/* | ||
This method locks the cursor for you, since sometimes doing it through Unity just doesn't work | ||
*/ | ||
LockCursorInternal: function () { | ||
document.getElementById("unity-canvas").requestPointerLock(); | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mergeInto(LibraryManager.library, { | ||
isMobile: function() { | ||
return /(iPhone|iPod|iPad|Android|BlackBerry|Windows Phone)/i.test(navigator.userAgent); | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.