using System.Collections.Generic; using UnityEngine; [CreateAssetMenu(fileName = "CharacterProperty", menuName = "ScriptableObject/Character/CharacterProperty")] public class CharacterProperty : ScriptableObject { public uint id; public Character prefab; public StatCreator[] stats; public SkillProperty[] skills; } public class CharacterData { CharacterProperty property; StatGroup statGroup; SkillData[] skills; public uint ID => property.id; public Character Prefab => property.prefab; public IReadOnlyList Skills => skills; public CharacterData(CharacterProperty property) { this.property = property; statGroup = new StatGroup(property.stats); skills = new SkillData[property.skills.Length]; for (int i = 0; i < skills.Length; i++) { skills[i] = new SkillData(property.skills[i]); } } public bool TryGetStat(StatID id, out StatData stat) => statGroup.TryGetStat(id, out stat); }