Last active
December 20, 2016 15:00
-
-
Save PopupAsylum/a348577645d4cc6ee53c04a811997f3f to your computer and use it in GitHub Desktop.
PointerCursor.jslib goes in Assets/Plugins/WebGL, PointerCursor.cs goes in your scripts folder, call PointerCursor.SetPointer(true) to set the cursor as a pointer
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
using System.Runtime.InteropServices; | |
public class PointerCursor : MonoBehaviour { | |
[DllImport("__Internal")] | |
public static extern void SetPointer(bool arg); | |
} |
This file contains hidden or 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
var PointerCursor = { | |
SetPointer: function(arg) | |
{ | |
document.getElementById("canvas").style.cursor = arg ? "pointer" : "default"; | |
console.log("Set Cursor"); | |
} | |
}; | |
mergeInto(LibraryManager.library, PointerCursor); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment