Saving Inventory Array when change level. Global Script?

How can i save my array vallue that i can see it when changing level?

rather than going through all of the trouble of saving the date to an xml, you might want to have an array of all the possible items for your inventory, and then using PlayerPrefs you could use PlayerPrefs.SetInt("ItemOne", indexOfItemInArray);. What this does is it saves this int to your library folder in the project, so when you get to the next level, you use objectsInBag[1] = PlayerPrefs.GetInt("ItemOne"); you would then clear out PlayerPrefs for the next use with PlayerPrefs.DeleteAll();. Hope it helps!!!

You may also find DontDestroyOnLoad helpful:

If you’re planning on keeping this array value around for the entire period of gameplay, you could also declare it a static var, which would only reset after the game is closed.