Files
2026-04-06 11:23:05 +07:00

47 lines
1.7 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster.Scripts.Chat.EmotionData
{
/// <summary>
/// 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).
/// </summary>
[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<EmotionEntryData> Entries = new List<EmotionEntryData>();
/// <summary>
/// Số ô theo chiều ngang trong atlas (texture width / CellWidth).
/// </summary>
public int GridCellsX => SourceAtlas != null && CellWidth > 0
? SourceAtlas.width / CellWidth
: 0;
/// <summary>
/// Số ô theo chiều dọc.
/// </summary>
public int GridCellsY => SourceAtlas != null && CellHeight > 0
? SourceAtlas.height / CellHeight
: 0;
public int TotalCells => GridCellsX * GridCellsY;
}
}