Ejemplo n.º 1
0
    public static T DeSerializer <T>(string path)
    {
        string        str          = UnGfx.LoadTextAsset(path);
        XmlSerializer serializer   = new XmlSerializer(typeof(T));
        StringReader  stringReader = new StringReader(str);
        XmlTextReader xmlReader    = new XmlTextReader(stringReader);
        T             data         = (T)serializer.Deserialize(xmlReader);

        xmlReader.Close();
        stringReader.Close();
        return(data);
    }
Ejemplo n.º 2
0
 static int LoadTextAsset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         string o    = UnGfx.LoadTextAsset(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }