protected override void Save(string savePath)
    {
        base.Save(savePath);
        // When the game will want to read the dialogue it does not care about visual stuff
        // so we serialize the gameplay info in another file in StreamingAssets
        Dialogue.Dialogue dialogue   = new Dialogue.Dialogue();
        string            rootNodeID = "";

        foreach (DialogueNode node in m_Graph.m_Nodes)
        {
            dialogue.AddNode(node.m_Node);
            if (node.IsRoot())
            {
                Assert.IsTrue(rootNodeID == "", "several root node found, this dialogue is ill formed");
                rootNodeID = node.m_ID;
            }
        }
        dialogue.m_RootNodeID = rootNodeID;
        string filename = Path.GetFileName(savePath);

        XMLSerializerHelper.Serialize(dialogue, Application.streamingAssetsPath + "/Dialogues/" + filename);
    }
Exemplo n.º 2
0
    public void SaveObject(AnyObject objectToSave, string filename)
    {
        string path = Application.streamingAssetsPath + m_SaveDirectory + filename;

        XMLSerializerHelper.Serialize(objectToSave, path);
    }
Exemplo n.º 3
0
 protected virtual void Save(string savePath)
 {
     XMLSerializerHelper.Serialize(m_Graph, savePath);
 }