/// <summary> /// get the cursor type, based on the enum /// </summary> private int GetCursorType(CursorEnum typeToEnable) { for (int i = 0; i < cursors.Count; i++) { if (cursors[i].type == typeToEnable) { return(i); } } Debug.Log("wrong cursor type"); return(-1); }
public void ChangeCursor(CursorEnum cursorType) { switch (cursorType) { case CursorEnum.normal: Cursor.SetCursor(Cursor_Normal, Vector2.zero, CursorMode.Auto); break; case CursorEnum.npc: Cursor.SetCursor(Cursor_Npc, Vector2.zero, CursorMode.Auto); break; case CursorEnum.skill: Cursor.SetCursor(Cursor_Skill, Vector2.zero, CursorMode.Auto); break; } }
/// <summary> /// initialize the cursor with a type /// </summary> public void Init(CursorEnum typeToEnable) { posOfCursors.ActiveAllChild(false); indexCursor = GetCursorType(typeToEnable); }