using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CursorHandler : MonoBehaviour
{

    private static bool lockedCursor;

    private static Texture2D bufferCursor;
    
    public static void ChangeCursor(Texture2D newCursor, bool save = true)
    {
        if (save)
            bufferCursor = newCursor;
        
        if (lockedCursor)
            return;

        Cursor.SetCursor(newCursor, Vector2.zero, CursorMode.Auto);
    }

    public static void ChangeLockState(bool newState)
    {
        lockedCursor = newState;
        ChangeCursor(bufferCursor);
    }
}
