From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Export/CursorBindings.txt | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Runtime/Export/CursorBindings.txt (limited to 'Runtime/Export/CursorBindings.txt') diff --git a/Runtime/Export/CursorBindings.txt b/Runtime/Export/CursorBindings.txt new file mode 100644 index 0000000..104bad4 --- /dev/null +++ b/Runtime/Export/CursorBindings.txt @@ -0,0 +1,44 @@ +C++RAW + +#include "UnityPrefix.h" +#include "Configuration/UnityConfigure.h" +#include "Runtime/Mono/MonoBehaviour.h" +#include "Runtime/BaseClasses/Cursor.h" + +using namespace std; + +CSRAW +using System; +using UnityEngine; +using Object=UnityEngine.Object; + +namespace UnityEngine +{ +// How should the custom cursor be rendered +ENUM CursorMode + // Use hardware cursors on supported platforms. + Auto = 0, + + // Force the use of software cursors. + ForceSoftware = 1, +END + +// Cursor API for setting the cursor that is used for rendering. +CLASS Cursor + + // Change the mouse cursor to the set texture OnMouseEnter. + + CSRAW static void SetCursor (Texture2D texture, CursorMode cursorMode) + { + SetCursor (texture, Vector2.zero, cursorMode); + } + + // + CUSTOM static void SetCursor (Texture2D texture, Vector2 hotspot, CursorMode cursorMode) + { + Cursors::SetCursor (texture, hotspot, cursorMode); + } +END + +CSRAW +} -- cgit v1.1-26-g67d0