Пример #1
0
    static void LoadConfigImpl <M, C>()
    {
        TypePair    tp     = GetTypeByClass <M>();
        TextAsset   result = Resources.Load("StaticConfigs/" + tp.GetFinalName()) as TextAsset;
        object      config = tp.m_TypeMain.GetMethod("Read").Invoke(null, new object[] { result.bytes });
        IDictionary dic    = tp.m_TypeMain.GetField("dict").GetValue(config) as IDictionary;

        ConfigData.AddConfig2Dict <C>(dic);

        IList list = tp.m_TypeMain.GetField("items").GetValue(config) as IList;

        ConfigData.AddConfig2List <C>(list);
    }