A Serializable class that is NOT a ScriptableObject. Instances of this class will not be assets, they will be stored inside a SOLDIER asset. As such, we do NOT need an editor for this object type, only a custom property drawer.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
{
[System.Serializable]
public class Weapon
{
[ExposeMember]
public WeaponType typeOfWeapon;
[ExposeMember]
public int currentAmmo;
[ExposeMember]
public string engraving;
[ExposeMember]
public int Quality = 1;
[ExposeMember]
public float Damage
{
get {
if (typeOfWeapon == null) return 0;
return typeOfWeapon.Damage * 2 * Quality;
}
}
}
}
|
int | currentAmmo |
|
string | engraving |
|
int | Quality |
|
WeaponType | typeOfWeapon |
|