Esempio n. 1
0
    public void SaveGame()
    {
        //print("--SaveGame()");
        SaveLoadXML.SetValue("PLAYER_INFO", GetStringValues());

        List <string> traitNames = new List <string>();

        foreach (Trait trait in traitList.FindAll(trait => trait.status))
        {
            traitNames.Add(trait.name);
        }
        if (traitNames.Count > 0)
        {
            SaveLoadXML.SetValue("TRAITS", traitNames.ToArray());
        }

        List <string> triggerNames = new List <string>();

        foreach (EventTriggers trigger in triggerList.FindAll(trigger => trigger.event_status))
        {
            triggerNames.Add(trigger.event_name);
        }
        if (triggerNames.Count > 0)
        {
            SaveLoadXML.SetValue("TRIGGER", triggerNames.ToArray());
        }

        if (QuestManager.Instance != null)
        {
            QuestManager.Instance.Save();
        }

        if (WorldTime.Instance != null)
        {
            WorldTime.Instance.Save();
        }

        if (EventManager.Instance != null)
        {
            EventManager.Instance.Save();
        }

        if (StoryManager.Instance != null)
        {
            StoryManager.Instance.SaveCompleteStory();
        }

        SaveLoadXML.SaveXML();
    }