示例#1
0
 /// <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);
 }
示例#2
0
    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;
        }
    }
示例#3
0
 /// <summary>
 /// initialize the cursor with a type
 /// </summary>
 public void Init(CursorEnum typeToEnable)
 {
     posOfCursors.ActiveAllChild(false);
     indexCursor = GetCursorType(typeToEnable);
 }