As the question states, how can I separate my GameData class which is serializable, into its own file?
I tried it and set GameData to be public class, but when I try to instantiate object of it into other class function Unity gives error:
error CS0246: The type or namespace name `GameData' could not be found. Are you missing a using directive or an assembly reference?
[Serializable]
public class GameData
{
public float experience = Helper.DEFAULT_EXPERIENCE;
public float score = Helper.DEFAULT_SCORE;
public float winPercent = Helper.DEFAULT_WIN_PERCENT;
public int tasksSolved = Helper.DEFAULT_NUM_OF_TASKS_SOLVED;
public int correct = Helper.DEFAULT_NUM_OF_CORRECT;
public int difficulty = Helper.DEFAULT_DIFFICULTY;
public bool gameStateDirty = Helper.DEFAULT_GAME_STATE_DIRTY;
public bool gameIsNormal = Helper.DEFAULT_GAME_IS_NORMAL;
}
Yes I am noob C# programmer but would like little help on the topic.
Thanks.