Files
test/Assets/PerfectWorld/Scripts/Chat/EmotionData/EmotionLibrarySO.cs
T
2026-04-06 11:23:05 +07:00

45 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster.Scripts.Chat.EmotionData
{
/// <summary>
/// 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).
/// </summary>
[Serializable]
public class EmotionSetSnapshot
{
public int EmotionSetIndex;
public int CellWidth = 32;
public int CellHeight = 32;
public Texture2D SourceAtlas;
public string SourceTxtAssetPath = "";
public List<EmotionEntryData> Entries = new List<EmotionEntryData>();
}
/// <summary>
/// Một ScriptableObject chứa nhiều bộ emotion (vd. emotions0emotions7).
/// Single SO holding multiple emotion sets (e.g. all 8 atlases).
/// </summary>
[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<EmotionSetSnapshot> Sets = new List<EmotionSetSnapshot>();
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;
}
}
}