- Home /
Question by
AkilaKannan · Jun 29, 2017 at 06:16 AM ·
unity 5mousemouse cursor
mouse cursor is not changing in browser
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class mouseScript : MonoBehaviour {
public Texture2D cursorTexture; public CursorMode cursorMode = CursorMode.Auto; public Vector2 hotSpot = Vector2.zero;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnMouseEnter()
{
Debug.Log("texture mouse " + cursorTexture + " cusor visiblity" + Cursor.visible);
Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
}
void OnMouseExit()
{
Cursor.SetCursor(null, Vector2.zero, cursorMode);
}
}
i changed the mouse image properties texture type - cursor, read/write - enable html5 - override for webgl, max size -32 , format - RGB compressed DXT1
i used this coding to change the mouse cursor. In unity editor it was working correctly, when i export to html5 mouse cursor is not changing
Comment