[CreateAssetMenu(menuName = "FreeToPlay/Weapon/Weapon setting")]
public class WeaponSettings : ScriptableObject
{
[Header("Values")]
[SerializeField] private string _key = default;
[SerializeField] private string _fullName = default;
[Header("Upgrade datas")]
[SerializeField] private Sprite _icon = default;
[Range(1,2)][SerializeField] private float _damageMultiplicator = 1;
[Range(1,2)][SerializeField] private float _priceMultiplicator = 1;
[Header("Zones & values")]
[SerializeField] private DamageZone[] _zones = default;
[Header("Effects")]
[SerializeField] private ParticleSystem _particles = default;
[SerializeField] private AudioClip _audio = default;
public DamageZone[] Zones => _zones;
public AudioClip Audio => _audio;
public ParticleSystem Particles => _particles;
public string Key => _key;
public string FullName => _fullName;
public Sprite Icon => _icon;
public float PriceMultiplicator => _priceMultiplicator;
public float DamageMultiplicator
{
get
{
int level = PlayerInventory.Instance.WeaponInventory.ItemCount(Key);
return level > 0 ? _damageMultiplicator * level : 1;
}
}
}