Ejemplo n.º 1
0
 public static List<DialogueSegment2D> Load(InteractionHostType type, IHasGuid obj)
 {
     var interactions = new List<DialogueSegment2D>();
     foreach (var f in Directory.GetFiles(GetDirectoryPath(GetDirectory(type), obj.Guid))) {
         interactions.Add(Load(f));
     }
     return interactions;
 }
Ejemplo n.º 2
0
 static string GetFilePath(InteractionHostType type, Guid guid, DialogueSegment2D interaction)
 {
     return GetDirectoryPath(GetDirectory(type), guid) + "/" + interaction.Guid.ToString() + ".json";
 }
Ejemplo n.º 3
0
 static string GetDirectory(InteractionHostType type)
 {
     if (type == InteractionHostType.Thing) return ThingDirectoryPath;
     else if (type == InteractionHostType.Trigger) return TriggerDirectoryPath;
     return "";
 }
Ejemplo n.º 4
0
 public static void Save(InteractionHostType type, Guid guid, DialogueSegment2D interaction)
 {
     var s = JsonConvert.SerializeObject(interaction, Formatting.Indented, settings);
     Serializer.SaveToFile(GetFilePath(type, guid, interaction), s);
 }