using System.Collections.Generic; using UnityEngine; namespace BrewMonster.Scripts.Chat.EmotionData { /// /// Dữ liệu một bộ emotion (tương ứng Emotions{N}.dds + Emotions{N}.txt). /// Data for one emotion group (matches Emotions{N}.dds + Emotions{N}.txt). /// [CreateAssetMenu(fileName = "EmotionSetData", menuName = "Perfect World/Chat/Emotion Set Data", order = 0)] public class EmotionSetDataSO : ScriptableObject { [Tooltip("N trong Emotions{N} (0..31 như AUIMANAGER_MAX_EMOTIONGROUPS).")] public int EmotionSetIndex; [Tooltip("Kích thước ô lưới giống C++ (mặc định 32x32).")] public int CellWidth = 32; [Tooltip("Kích thước ô lưới giống C++ (mặc định 32x32).")] public int CellHeight = 32; [Tooltip("Texture nguồn (atlas PNG/DDS import) dùng khi convert.")] public Texture2D SourceAtlas; [Tooltip("Đường dẫn asset của file txt nguồn (optional, để trace).")] public string SourceTxtAssetPath; public List Entries = new List(); /// /// Số ô theo chiều ngang trong atlas (texture width / CellWidth). /// public int GridCellsX => SourceAtlas != null && CellWidth > 0 ? SourceAtlas.width / CellWidth : 0; /// /// Số ô theo chiều dọc. /// public int GridCellsY => SourceAtlas != null && CellHeight > 0 ? SourceAtlas.height / CellHeight : 0; public int TotalCells => GridCellsX * GridCellsY; } }