Example #1
0
        public void SaveParcours()
        {
            Parcours p = new Parcours
            {
                JouetObjets = new List <JouetObjet>()
            };

            foreach (GameObject go in lesGOs)
            {
                p.JouetObjets.Add(JouetObjet.toJouetObjet(go));
            }

            if (gameData == null)
            {
                gameData = new GameData
                {
                    Parcours = new List <Parcours>()
                };
            }
            else if (gameData.Parcours == null)
            {
                gameData.Parcours = new List <Parcours>();
            }

            gameData.Parcours.Add(p);

            SaveJson();
        }