コード例 #1
0
        public static GameContainer Load(string fileName)
        {
            XmlSerializer serializer    = new XmlSerializer(typeof(GameContainer));
            TextReader    reader        = new StreamReader(System.IO.Path.Combine(Application.persistentDataPath, fileName));
            GameContainer gameContainer = serializer.Deserialize(reader) as GameContainer;

            reader.Close();
            Debug.Log(gameContainer.name + "   GameContainer loaded from XML file\n");
            return(gameContainer);
        }
コード例 #2
0
        public GameContainer CreateNewGameContainer(string name)
        {
            GameContainer gc = new GameContainer(true);

            gc.name = name;
            gc.Save();
            gameNames.Add(name);
            Save();
            gc = GameContainer.Load(name);
            return(gc);
        }