#More details on my issue. 1234

1 messages · Page 1 of 1 (latest)

subtle solar
#
    public enum weaponType { Nothing, Repeater, Ballistic, Cannon }

    [Tooltip("Here you can specify the weapon type which will change the stats it uses.")]
    [SerializeReference]
    public weaponType type;


    [Header("Weapon Stats")]
    
    public RepeaterStats repeaterStats;
    public BallisticStats ballisticStats;
    public CannonStats cannonStats;
   
    #endregion
}

#region Weapon Variables

[System.Serializable]
public class RepeaterStats
{
    public float maxChargedAmmo;
    public float laserDamage;
    public float lasersPerSecond;
    public float dropoffDistance;
    public float chargingSpeed;
}

[System.Serializable]
public class BallisticStats
{
    public float maxBallisticAmmo;
    public float bulletSpread;
    public float bulletDamage;
    public float bulletsPerSecond;
    public float heatLimit;
}

[System.Serializable]
public class CannonStats
{
    public float maxCannonShells;
    public float shellDamage;
    public float reloadTime;
dreamy saffron
#

No idea what your issue is, but you should probably use SerializeReference instead of doing what you are doing. At the moment, you have stats for all the weapon type while you only need the stats for one particular weapon type.