first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OTGIntegrated.Abilities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "AbilityData", menuName = "OTG Integrated/Ability Data")]
|
||||
public sealed class AbilityData : ScriptableObject
|
||||
{
|
||||
public string abilityId;
|
||||
public string displayName;
|
||||
[TextArea(2, 5)] public string description;
|
||||
public float manaCost = 10f;
|
||||
public float cooldown = 2f;
|
||||
public float damage = 10f;
|
||||
public float range = 8f;
|
||||
public GameObject effectPrefab;
|
||||
public Sprite icon;
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(abilityId))
|
||||
{
|
||||
abilityId = name;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(displayName))
|
||||
{
|
||||
displayName = abilityId;
|
||||
}
|
||||
|
||||
manaCost = Mathf.Max(0f, manaCost);
|
||||
cooldown = Mathf.Max(0f, cooldown);
|
||||
damage = Mathf.Max(0f, damage);
|
||||
range = Mathf.Max(0f, range);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user