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

public class MouseGraphic : MonoBehaviour {
    [System.Serializable]
    public struct MouseCursor {
        public Texture2D texture;
        public Vector2 hotSpot;
    }

    public MouseCursor MouseUp;
    public MouseCursor MouseDown;

    MouseCursor cursor {
        set { Cursor.SetCursor(value.texture, value.hotSpot, UnityEngine.CursorMode.Auto); }
    }

    void Start() {
        cursor = MouseUp;
    }

    void Update() {
        if (Input.GetMouseButtonDown(0)) {
            cursor = MouseDown;
        }

        if (Input.GetMouseButtonUp(0)) {
            cursor = MouseUp;
        }
    }
}
