Created
December 20, 2016 15:00
-
-
Save PopupAsylum/a15b3f767b7e767480352640ac2a4998 to your computer and use it in GitHub Desktop.
PointerCursor.jslib goes in Assets/Plugins/WebGL, PointerCursor.cs goes in your scripts folder, call SetPointer(true) to set the cursor as a pointer
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
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 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