Editor Question - Saving Data into the Object

I don’t like to ask quests until I thoroughly search documents and others forum posts… I know how people get.

But I still have not found a solution to my problem. I’ve gotten further then I was but still not there.

I however cannot seem to find how to get Custom Data Types to save correctly when loaded. I’ve read that if its not in the editor it won’t be loaded. I’ve gotten them to show in the editor and still they go back to there initial null/blank values upon starting…

I’m currently making a simple Quest System that I hope to tweak as I get more understand of this but here is a bit of the code I’m using to save the variables based on what other people have said…

** Using this with my own Custom Editor **

C# by the way :

List<QuestDialog> _questDialog = new List<QuestDialog>();				//Dialog
	public List<QuestDialog> DialogList{
		get {return _questDialog;}
	}
	
	[SerializeField]
	List<QuestObjectives> _questObjectives = new List<QuestObjectives>();	//Objectives
	public List<QuestObjectives> ObjectivesList{
		get {return _questObjectives;}
	}
	
	[SerializeField]
	QuestReward _questReward = new QuestReward();							//Rewards
	public QuestReward Reward{
		get {return _questReward;}
		set {_questReward = value;}
	}

	
	//Set Quest items
	public void addQuestDialog(string dialog, string accept, string decline)
	{
		QuestDialog temp = new QuestDialog(dialog, accept, decline);
		_questDialog.Add(temp);
	}

I currently have Classes made that handle each add Method.

[System.Serializable]
public class QuestDialog
	{
		string dialog;
		string inputAccept;
		string inputDecline;
		
		public QuestDialog(string dialog, string accept, string decline)
		{
			Debug.Log("adding new dialog");
			this.dialog = dialog;
			inputAccept = accept;
			inputDecline = decline;
 ..// So on
}

– And here is an Image of it running

So it is showing all the elements and such but they are all null/empty back to nothing on start up.

I’m sure someone knows how to fix this or work around it. Any information would be highly appreciated, since I’ve been stuck on this one problem for a few days now.

Anyways, I’ll be working on figuring it out in the mean time!

Don’t mean to Double Post but. I just got it work…

I don’t know if this is a super Valid Solution but what I did was change all the variables in myClasses to public… When I switch them to private they always will initialize back to null or blank. I guess it could be something wrong with my code however, very possible.

This works and I shall be happy with myself for awhile. If anyone has any input still I would like to hear about it.