예제 #1
0
        void Parse()
        {
            forest = new DialogueForest();
            forest.ParseFromFile(idpFilePath);

            Debug.Log("Parsed successfully");
        }
예제 #2
0
        public static DialogueForest DeserializeFromBinary(string fileName)
        {
            if (!File.Exists(fileName))
            {
                Debug.LogError("Deserialization attempt failed. File " + fileName + " doesn't exist");
                return(null);
            }

            BinaryFormatter bf     = new BinaryFormatter();
            FileStream      file   = File.Open(fileName, FileMode.Open);
            DialogueForest  forest = (DialogueForest)bf.Deserialize(file);

            file.Close();

            forest.PopulateDict();

            return(forest);
        }
예제 #3
0
        public void CombineWith(DialogueForest forest)
        {
            var parsedDict = forest.treeDict;

            parsedDict.ToList().ForEach(x => treeDict.Add(x.Key, x.Value));
        }
예제 #4
0
        void Deserialize()
        {
            forest = DialogueForest.DeserializeFromBinary(binaryFilePath);

            Debug.Log("Deserialized successfully");
        }