Пример #1
0
        /// <summary>
        /// Writes the datafiles, asking the user for overwriting.
        /// </summary>
        /// <param name="gestures">Gestures list container</param>
        /// <param name="categories">Categories list container.</param>
        /// <param name="locations">Locations list container.</param>
        /// <param name="names">Names list container.</param>
        /// <param name="questions">Questions list container.</param>
        private static void WriteDatafiles(GestureContainer gestures, CategoryContainer categories, RoomContainer locations, NameContainer names, QuestionsContainer questions)
        {
            string path = Loader.GetPath("Gestures.xml");

            if (Overwrite(path))
            {
                Loader.Save(path, gestures);
            }
            path = Loader.GetPath("Locations.xml");
            if (Overwrite(path))
            {
                Loader.Save(path, locations);
            }
            path = Loader.GetPath("Names.xml");
            if (Overwrite(path))
            {
                Loader.Save(path, names);
            }
            path = Loader.GetPath("Objects.xml");
            if (Overwrite(path))
            {
                Loader.Save(path, categories);
            }
            path = Loader.GetPath("Questions.xml");
            if (Overwrite(path))
            {
                Loader.Save(path, questions);
            }
        }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        GestureXml       ges          = new GestureXml();
        GestureContainer gesContainer = new GestureContainer();



        //gesT = new GestureTemplates();

        ges.pos = new Vector2[64];


        for (int j = 0; j < 2; j++)
        {
            temp = (ArrayList)GestureTemplates.Templates[j];

            for (int i = 0; i < temp.Count; i++)
            {
                ges.pos[i] = (Vector2)temp[i];
            }

            ges.name = (string)GestureTemplates.TemplateNames[j];

            gesContainer.gestures.Add(ges);
        }

        //Debug.Log(ges.pos.Count);
        //Debug.Log(ges.name);

        gesContainer.Save("save.xml");



        //GestureContainer gesCon = GestureContainer.Load("save.xml");

        //Debug.Log(gesCon.gestures[0].pos[0]);
    }