26 lines
663 B
C#
26 lines
663 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
[CreateAssetMenu(fileName = "TalentData", menuName = "Talents/TalentData")]
|
||
|
|
public class TalentData : ScriptableObject
|
||
|
|
{
|
||
|
|
public string talentId;
|
||
|
|
public string displayName;
|
||
|
|
[TextArea(2, 5)] public string description;
|
||
|
|
public Sprite icon;
|
||
|
|
public int cost = 1;
|
||
|
|
public TalentData[] prerequisites;
|
||
|
|
public StatModifier[] modifiers;
|
||
|
|
public Vector2 treePosition;
|
||
|
|
public Color branchColor = Color.white;
|
||
|
|
public bool unlockedByDefault;
|
||
|
|
|
||
|
|
private void OnValidate()
|
||
|
|
{
|
||
|
|
cost = Mathf.Max(0, cost);
|
||
|
|
if (string.IsNullOrWhiteSpace(talentId))
|
||
|
|
{
|
||
|
|
talentId = name;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|