Arcane/Magic explosion prototype criado knowledge level changed to scriptable começado prefabs de systems criados e atualizados
27 lines
678 B
C#
27 lines
678 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[CreateAssetMenu(fileName = "Spell", menuName = "Custom/Spells/New Spell")]
|
|
public class Spell : ScriptableObject
|
|
{
|
|
public FloatVariable Level;
|
|
public GameObject SpellObject;
|
|
public float Cooldown;
|
|
public SpellType CastType;
|
|
|
|
[SerializeField] private float baseDamageValue;
|
|
[SerializeField] private float growthPerLevel;
|
|
[SerializeField] private float exponent;
|
|
|
|
public float GetFinalDamageValue()
|
|
{
|
|
return baseDamageValue + Level.Value * Mathf.Pow(growthPerLevel, exponent);
|
|
}
|
|
}
|
|
|
|
public enum SpellType
|
|
{
|
|
CastOnPlayerPosition,
|
|
Projectile
|
|
} |