Custom editor for scriptable objects not working

Hello everyone,

I am currently working on a versatile weapon system and I am trying to add a variable to the inspector. At first, I was using scripts to store variables, but recently I switched over to scriptable objects. I already had a custom editor working for the variables in the script and when I changed the editor script so it would target the scriptable object script instead of the weapon script, everything worked for a while. Yesterday, I tried to add another variable and make it show up in the inspector, but nothing changed. When I removed other variables, the inspector also didn’t remove them, even though they were never called in the custom editor script. The inspector for the scriptable objects is just kinda frozen.

This is the editor script I used:

[CustomEditor(typeof(WeaponScriptableObjects))]
public class WeaponScriptableObjectsEditor : Editor
{
    #region SerializedProperties
    SerializedProperty weaponSystem;
    SerializedProperty ammoType;
    SerializedProperty fireRate;
    SerializedProperty damage;
    SerializedProperty hitEffects;
    SerializedProperty ammoSlot;
    SerializedProperty playerCamera;
    SerializedProperty firePoint;
    SerializedProperty muzzleFlash;
    SerializedProperty bulletVelocity;
    SerializedProperty bulletVisibilityDelay;
    SerializedProperty magazineSize;
    SerializedProperty bullet;
    SerializedProperty range;
    SerializedProperty reloadSpeed;
    SerializedProperty ammoText;
    SerializedProperty ammoSystem;
    SerializedProperty weaponSpread;
    SerializedProperty UniqueAmmo;
    SerializedProperty ReuseAmmo;
    SerializedProperty startingAmmoAmount;
    SerializedProperty defaultHitEffect;
    SerializedProperty GunPrefab;
    SerializedProperty GunPosition;
    SerializedProperty GunRotation;

    bool AmmoGroup, WeaponGroup, ObjectGroup, GunGroup = false;

    #endregion

    void OnEnable()
    {
        weaponSystem = serializedObject.FindProperty("weaponSystem");
        ammoType = serializedObject.FindProperty("ammoType");
        fireRate = serializedObject.FindProperty("fireRate");
        damage = serializedObject.FindProperty("damage");
        hitEffects = serializedObject.FindProperty("hitEffects");
        ammoSlot = serializedObject.FindProperty("ammoSlot");
        playerCamera = serializedObject.FindProperty("playerCamera");
        firePoint = serializedObject.FindProperty("firePoint");
        muzzleFlash = serializedObject.FindProperty("muzzleFlash");
        bulletVelocity = serializedObject.FindProperty("bulletVelocity");
        bulletVisibilityDelay = serializedObject.FindProperty("bulletVisibilityDelay");
        bullet = serializedObject.FindProperty("bullet");
        range = serializedObject.FindProperty("range");
        magazineSize = serializedObject.FindProperty("magazineSize");
        reloadSpeed = serializedObject.FindProperty("reloadSpeed");
        ammoText = serializedObject.FindProperty("ammoText");
        ammoSystem = serializedObject.FindProperty("ammoSystem");
        weaponSpread = serializedObject.FindProperty("weaponSpread");
        UniqueAmmo = serializedObject.FindProperty("UniqueAmmo");
        ReuseAmmo = serializedObject.FindProperty("ReuseAmmo");
        startingAmmoAmount = serializedObject.FindProperty("startingAmmoAmount");
        defaultHitEffect = serializedObject.FindProperty("defaultHitEffect");
        GunPrefab = serializedObject.FindProperty("GunPrefab");
        GunPosition = serializedObject.FindProperty("GunPosition");
        GunRotation = serializedObject.FindProperty("GunRotation");
    }

    public override void OnInspectorGUI()
    {
        WeaponScriptableObjects weaponScriptableObjects = (WeaponScriptableObjects)target;

        serializedObject.Update();

        EditorGUILayout.PropertyField(weaponSystem);
        EditorGUILayout.Space();

        GunGroup = EditorGUILayout.BeginFoldoutHeaderGroup(GunGroup, "Gun Prefab");
        if(GunGroup)
        {
            EditorGUILayout.PropertyField(GunPrefab);
            EditorGUILayout.PropertyField(GunPosition);
            EditorGUILayout.PropertyField(GunRotation);
        }
        EditorGUILayout.EndFoldoutHeaderGroup();

        AmmoGroup = EditorGUILayout.BeginFoldoutHeaderGroup(AmmoGroup, "Ammo Settings");
        if (AmmoGroup)
        {
            EditorGUILayout.PropertyField(ammoSystem);
            EditorGUILayout.PropertyField(UniqueAmmo);
            if (weaponScriptableObjects.ammoSystem == AmmoSystem.Realistic)
            {
                EditorGUILayout.PropertyField(ReuseAmmo);
            }
            EditorGUILayout.Space();
            if (!weaponScriptableObjects.UniqueAmmo)
            {
                EditorGUILayout.PropertyField(ammoSlot);
                EditorGUILayout.PropertyField(ammoType);
            }
            else
            {
                EditorGUILayout.PropertyField(startingAmmoAmount);
            }
            EditorGUILayout.PropertyField(magazineSize);
            EditorGUILayout.PropertyField(reloadSpeed);
            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(ammoText);

        }
        EditorGUILayout.EndFoldoutHeaderGroup();

        WeaponGroup = EditorGUILayout.BeginFoldoutHeaderGroup(WeaponGroup, "Weapon Settings");
        if (WeaponGroup)
        {
            if (weaponScriptableObjects.weaponSystem == WeaponSystem.hitscan)
            {
                EditorGUILayout.PropertyField(range);
            }
            if (weaponScriptableObjects.weaponSystem == WeaponSystem.projectile)
            {
                EditorGUILayout.PropertyField(firePoint);
                EditorGUILayout.PropertyField(bulletVelocity);
                EditorGUILayout.PropertyField(bulletVisibilityDelay);
            }

            EditorGUILayout.PropertyField(fireRate);
            EditorGUILayout.PropertyField(damage);
            EditorGUILayout.PropertyField(weaponSpread);
        }       
        EditorGUILayout.EndFoldoutHeaderGroup();
 
        ObjectGroup = EditorGUILayout.BeginFoldoutHeaderGroup(ObjectGroup, "GameObjects");
        if (ObjectGroup)
        {
            EditorGUILayout.PropertyField(playerCamera);
            EditorGUILayout.PropertyField(muzzleFlash);
            if (weaponScriptableObjects.weaponSystem == WeaponSystem.projectile)
            {
                EditorGUILayout.PropertyField(bullet);
            }
        }
        EditorGUILayout.EndFoldoutHeaderGroup();
   
        EditorGUILayout.PropertyField(hitEffects);
        EditorGUILayout.PropertyField(defaultHitEffect);
        EditorGUILayout.EndFoldoutHeaderGroup();
        serializedObject.ApplyModifiedProperties();
    }
}

Its resolved, I had accidentally copied the editor script