31 lines
965 B
C#
31 lines
965 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
namespace UVC.Edit
|
|
{
|
|
public class LibraryItem : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
|
{
|
|
public GameObject prefabToSpawn; // 이 아이템이 생성할 프리팹
|
|
public static GameObject DraggedPrefab; // 현재 드래그 중인 프리팹 (static으로 공유)
|
|
|
|
public void OnBeginDrag(PointerEventData eventData)
|
|
{
|
|
DraggedPrefab = prefabToSpawn;
|
|
// 드래그 시 시각적 효과 (예: 아이콘 반투명화)
|
|
}
|
|
|
|
public void OnDrag(PointerEventData eventData) { } // 드래그 중 로직 (필요 시)
|
|
|
|
public void OnEndDrag(PointerEventData eventData)
|
|
{
|
|
DraggedPrefab = null;
|
|
// 드래그 종료 시 시각적 효과 원상복구
|
|
}
|
|
}
|
|
}
|