Пример #1
0
        public static void SaveToFile(System.SerializableAttribute data, string filename)
        {
            Debug.Log(Application.persistentDataPath);
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Create(GetFullPath(filename));

            bf.Serialize(file, data);
            file.Close();
        }
Пример #2
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    System.SerializableAttribute gen_ret = new System.SerializableAttribute();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to System.SerializableAttribute constructor!"));
        }