using System;
using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster.Scripts.Chat.EmotionData
{
///
/// Snapshot một bộ Emotions{N} (dùng embed trong EmotionLibrarySO hoặc copy sang EmotionSetDataSO).
/// One Emotions{N} snapshot (embedded in EmotionLibrarySO or copied to EmotionSetDataSO).
///
[Serializable]
public class EmotionSetSnapshot
{
public int EmotionSetIndex;
public int CellWidth = 32;
public int CellHeight = 32;
public Texture2D SourceAtlas;
public string SourceTxtAssetPath = "";
public List Entries = new List();
}
///
/// Một ScriptableObject chứa nhiều bộ emotion (vd. emotions0–emotions7).
/// Single SO holding multiple emotion sets (e.g. all 8 atlases).
///
[CreateAssetMenu(fileName = "EmotionLibrary", menuName = "Perfect World/Chat/Emotion Library (All Sets)", order = 1)]
public class EmotionLibrarySO : ScriptableObject
{
[Tooltip("Danh sách các bộ theo EmotionSetIndex (0,1,2,…).")]
public List Sets = new List();
public EmotionSetSnapshot GetSetOrNull(int emotionSetIndex)
{
if (Sets == null) return null;
foreach (var s in Sets)
{
if (s != null && s.EmotionSetIndex == emotionSetIndex)
return s;
}
return null;
}
}
}