using System;
using System.Collections.Generic;
using UnityEngine;
namespace Streamingle.Prop
{
///
/// 프랍 정보를 담는 데이터 클래스
///
[Serializable]
public class PropInfo
{
public string propName; // 프랍 이름
public string folderPath; // 프랍 폴더 경로 (Assets/...)
public string thumbnailPath; // 썸네일 이미지 경로
public Texture2D thumbnail; // 로드된 썸네일 (런타임용)
public List prefabPaths = new List(); // 프리펩 경로들
public List modelPaths = new List(); // 모델 파일 경로들
public int textureCount; // 텍스처 파일 수
public int materialCount; // 머티리얼 파일 수
public string DisplayName => propName;
///
/// 대표 프리펩 경로 (첫 번째)
///
public string MainPrefabPath => prefabPaths.Count > 0 ? prefabPaths[0] : null;
}
///
/// 프랍 데이터를 저장하는 ScriptableObject
///
[CreateAssetMenu(fileName = "PropDatabase", menuName = "Streamingle/Prop Database")]
public class PropDatabase : ScriptableObject
{
public List props = new List();
///
/// 프랍 이름으로 검색
///
public PropInfo FindByName(string propName)
{
return props.Find(p => p.propName == propName);
}
///
/// 폴더 경로로 검색
///
public PropInfo FindByPath(string folderPath)
{
return props.Find(p => p.folderPath == folderPath);
}
}
}