/// <summary> /// Tell JavaScript to make a DOM object with htmlObjectID to align with the Image component /// </summary> private void AlignHTMLOverlay() { var screenSpaceRectangle = GetScreenSpaceRectangle(); JavascriptMethodCaller.DisplayWithID(htmlObjectID, true, screenSpaceRectangle.x / Screen.width, screenSpaceRectangle.y / Screen.height, screenSpaceRectangle.width / Screen.width, screenSpaceRectangle.height / Screen.height ); }
//We can use a static method here, since we change the style as a whole for the //entire WebGL canvas. Check out w3schools for more cursor styles: https://www.w3schools.com/cssref/pr_class_cursor.asp public static void ChangeCursor(Style type) { cursorType = type; var cursorString = ""; switch (cursorType) { case Style.AUTO: cursorString = "auto"; break; case Style.POINTER: cursorString = "pointer"; break; case Style.TEXT: cursorString = "text"; break; case Style.GRAB: cursorString = "grab"; break; case Style.GRABBING: cursorString = "grabbing"; break; case Style.ERESIZE: cursorString = "e-resize"; break; case Style.PROGRESS: cursorString = "progress"; break; } JavascriptMethodCaller.ChangeCursor(cursorString); }
private void OnDisable() { JavascriptMethodCaller.DisplayWithID(htmlObjectID, false); }