34 lines
877 B
C#
34 lines
877 B
C#
using OTGIntegrated.Stats;
|
|
using UnityEngine;
|
|
|
|
namespace OTGIntegrated.Talents
|
|
{
|
|
[CreateAssetMenu(fileName = "TalentData", menuName = "OTG Integrated/Talent Data")]
|
|
public sealed class TalentData : ScriptableObject
|
|
{
|
|
public string talentId;
|
|
public string displayName;
|
|
[TextArea(2, 5)] public string description;
|
|
public Sprite icon;
|
|
[Min(0)] public int cost = 1;
|
|
public TalentData[] prerequisites;
|
|
public StatModifier[] modifiers;
|
|
public Vector2 treePosition;
|
|
|
|
private void OnValidate()
|
|
{
|
|
if (string.IsNullOrWhiteSpace(talentId))
|
|
{
|
|
talentId = name;
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(displayName))
|
|
{
|
|
displayName = talentId;
|
|
}
|
|
|
|
cost = Mathf.Max(0, cost);
|
|
}
|
|
}
|
|
}
|