using System.Collections.Generic;
using UnityEngine;
namespace Streamingle.Background
{
///
/// 배경 씬 데이터를 저장하는 ScriptableObject
///
[CreateAssetMenu(fileName = "BackgroundSceneDatabase", menuName = "Streamingle/Background Scene Database")]
public class BackgroundSceneDatabase : ScriptableObject
{
public List scenes = new List();
///
/// 카테고리별로 씬 목록 반환
///
public Dictionary> GetScenesByCategory()
{
var result = new Dictionary>();
foreach (var scene in scenes)
{
string category = scene.Category;
if (!result.ContainsKey(category))
{
result[category] = new List();
}
result[category].Add(scene);
}
return result;
}
///
/// 씬 이름으로 검색
///
public BackgroundSceneInfo FindByName(string sceneName)
{
return scenes.Find(s => s.sceneName == sceneName);
}
///
/// 씬 경로로 검색
///
public BackgroundSceneInfo FindByPath(string scenePath)
{
return scenes.Find(s => s.scenePath == scenePath);
}
}
}