Save an index with playerPrefs

Hello , this is Mahsa

I have script that controls upgrading weapon , the point is I have two factory for weapons one of em is axe another one is pickaxe.
I have index that these two share in script when I’m saving the index to player prefs and load it
it will effect two script even I didn’t press the upgrade button
can some tell me how can i seperatly save index in a single script ?

public int index = 0;

public void OnClickToUpgrade()
{
    if(WeaponScriptable.Count == 0) return;
    StartCoroutine(SpawnResource(player, player.playerSpawnPoint));
}

private IEnumerator SpawnResource(PlayerTileCollector player, Transform playerSpawnPoint)
{
    if (index > 6)
    {
        yield break;
    }
    
    chosenWeapon = WeaponScriptable[index];
        
    var list = chosenWeapon.RequiredResourceList;
        
    for (int j = 0; j < list.Count; j++)
    {
        StartCoroutine(GetResourceToSpawn(player, playerSpawnPoint,list[j]));
    }

    weaponMeshManager.UpgradeWeapon();

    WeaponInfoCanvas.gameObject.SetActive(false);

    yield return new WaitForSeconds(8f);

    if (list.All(x => x.ResourceAmount == 0))
    {
        index++;
        PlayerPrefs.SetInt("Index", index);
        Debug.Log("Index has saved");
    }
}
public int axeIndex = 0; // Separate index for the axe
public int pickaxeIndex = 0; // Separate index for the pickaxe

public void OnClickToUpgrade()
{
    if (WeaponScriptable.Count == 0) return;
    StartCoroutine(SpawnResource(player, player.playerSpawnPoint));
}

private IEnumerator SpawnResource(PlayerTileCollector player, Transform playerSpawnPoint)
{
    if (index > 6)
    {
        yield break;
    }

    chosenWeapon = WeaponScriptable[index];

    var list = chosenWeapon.RequiredResourceList;

    for (int j = 0; j < list.Count; j++)
    {
        StartCoroutine(GetResourceToSpawn(player, playerSpawnPoint, list[j]));
    }

    weaponMeshManager.UpgradeWeapon();

    WeaponInfoCanvas.gameObject.SetActive(false);

    yield return new WaitForSeconds(8f);

    if (list.All(x => x.ResourceAmount == 0))
    {
        // Check which weapon is being upgraded and save the corresponding index
        if (chosenWeapon.IsAxe) // You can add a property or flag in your WeaponScriptable to determine the weapon type
        {
            axeIndex++;
            PlayerPrefs.SetInt("AxeIndex", axeIndex);
            Debug.Log("Axe Index has saved");
        }
        else if (chosenWeapon.IsPickaxe) // Add similar flag for the pickaxe
        {
            pickaxeIndex++;
            PlayerPrefs.SetInt("PickaxeIndex", pickaxeIndex);
            Debug.Log("Pickaxe Index has saved");
        }
    }
}