I’m making a small database that’s used to save Dropdown values (integers) in a XML database… currently it’s set up like this:
public class XMLManager : MonoBehaviour {
//other code before the variable below
public VideoSettings vSettingsDB;
//save function
public void SaveItems()
{
//Configure save
itemEntry.configSettings(); //This is what I basically am trying to aim for, but with no luck
//open a new xml file
XmlSerializer serializer = new XmlSerializer(typeof(VideoSettings));
FileStream stream = new FileStream(Application.persistentDataPath, FileMode.Create);
serializer.Serialize(stream, vSettingsDB);
stream.Close();
}
//load function (not done yet)
}
[System.Serializable]
public class itemEntry
{
public int resolutionValue, shadowValue, lightValue, textureValue;
public bool vSyncValue;
UserInterfaceScript UI;
public void configSettings()
{
UI = GameObject.Find("GUI").GetComponent<UserInterfaceScript>();
resolutionValue = UI.resolutionSetting.value;
shadowValue = UI.shadowQuality.value;
lightValue = UI.lightMode.value;
textureValue = UI.textureQuality.value;
vSyncValue = UI.VSync.isOn;
}
}
[System.Serializable]
public class VideoSettings
{
public List<itemEntry> list = new List<itemEntry>();
}
I need some help as I can’t find anything related to modifying variables of another class in the same file