示例#1
0
    void Start()
    {
        AllNationData.Init();
        GeneratorSettings.Initialize();

        s_generation_manager = this;
        m_content            = new List <GameObject>();
        m_log_content        = new List <GameObject>();

        load_layouts();
        load_nation_data();
        update_nations();
        hide_controls();
    }
示例#2
0
    private void Start()
    {
        AllNationData.Init();
        GeneratorSettings.Initialize();

        s_generation_manager = this;
        m_content            = new List <GameObject>();
        m_log_content        = new List <GameObject>();

        Application.logMessageReceived += handle_log;

        load_name_data();
        load_layouts();
        load_nation_data();
        update_nations();
        hide_controls();
        OnBorderColorUpdate();
        OnOverlayColorUpdate();
    }
示例#3
0
    void load_nation_data()
    {
        string data_folder = Application.dataPath;
        string folder      = data_folder + "/Nations/";

        foreach (string file in Directory.GetFiles(folder))
        {
            if (file.Contains(".meta"))
            {
                continue;
            }

            string           contents   = File.ReadAllText(file);
            var              serializer = new XmlSerializer(typeof(NationCollection));
            NationCollection result;

            using (TextReader reader = new StringReader(contents))
            {
                result = (NationCollection)serializer.Deserialize(reader);
            }

            AllNationData.AddNations(result);
        }
    }