예제 #1
0
        static internal void Lua_System_Action_1_BundleSmallData(LuaFunction ld, BundleSmallData a1)
        {
            IntPtr l     = ld.L;
            int    error = pushTry(l);

            pushValue(l, a1);
            ld.pcall(1, error);
            LuaDLL.lua_settop(l, error - 1);
        }
예제 #2
0
 static public int get_sceneBundle(IntPtr l)
 {
     try {
         BundleSmallData self = (BundleSmallData)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.sceneBundle);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #3
0
 static public int constructor(IntPtr l)
 {
     try {
         BundleSmallData o;
         o = new BundleSmallData();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        static internal bool Lua_System_Predicate_1_BundleSmallData(LuaFunction ld, BundleSmallData a1)
        {
            IntPtr l     = ld.L;
            int    error = pushTry(l);

            pushValue(l, a1);
            ld.pcall(1, error);
            bool ret;

            checkType(l, error + 1, out ret);
            LuaDLL.lua_settop(l, error - 1);
            return(ret);
        }
예제 #5
0
 static public int set_includs(IntPtr l)
 {
     try {
         BundleSmallData self = (BundleSmallData)checkSelf(l);
         System.Collections.Generic.List <System.String> v;
         checkType(l, 2, out v);
         self.includs = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #6
0
 static public int set_name(IntPtr l)
 {
     try {
         BundleSmallData self = (BundleSmallData)checkSelf(l);
         System.String   v;
         checkType(l, 2, out v);
         self.name = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #7
0
 static public int set_compressedSize(IntPtr l)
 {
     try {
         BundleSmallData self = (BundleSmallData)checkSelf(l);
         System.Int64    v;
         checkType(l, 2, out v);
         self.compressedSize = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #8
0
 static public int set_bEncrypt(IntPtr l)
 {
     try {
         BundleSmallData self = (BundleSmallData)checkSelf(l);
         System.Boolean  v;
         checkType(l, 2, out v);
         self.bEncrypt = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #9
0
        static internal int Lua_System_Comparison_1_BundleSmallData(LuaFunction ld, BundleSmallData a1, BundleSmallData a2)
        {
            IntPtr l     = ld.L;
            int    error = pushTry(l);

            pushValue(l, a1);
            pushValue(l, a2);
            ld.pcall(2, error);
            int ret;

            checkType(l, error + 1, out ret);
            LuaDLL.lua_settop(l, error - 1);
            return(ret);
        }
예제 #10
0
        /// <summary>
        /// Build bundle manager file(bm.data)
        /// </summary>
        /// <param name="manifestpath"></param>
        public static void MakeBMFile(string manifestpath)
        {
            List <BundleSmallData> AllBundleData = new List <BundleSmallData>();

            //特殊处理:如果没有打任何包
            if (!File.Exists(manifestpath + "/tmp.manifest"))
            {
            }
            else
            {
                string bundlebasepath = manifestpath;


                AssetBundle         bundlemanifest = AssetBundle.LoadFromFile(manifestpath + "/tmp");
                AssetBundleManifest ABM            = bundlemanifest.LoadAsset <AssetBundleManifest>("AssetBundleManifest");

                bundlemanifest.Unload(false);

                AssetDatabase.RemoveUnusedAssetBundleNames();

                string[] AllBundles = AssetDatabase.GetAllAssetBundleNames();

                foreach (var bundle in AllBundles)
                {
                    if (bundle == "BM.data" || bundle == "bm.data")
                    {
                        continue;
                    }

                    BundleSmallData newData = new BundleSmallData();

                    newData.name = bundle;
                    foreach (var asp in AssetDatabase.GetAssetPathsFromAssetBundle(bundle))
                    {
                        newData.includs.Add(asp);
                    }

                    foreach (var parents in ABM.GetAllDependencies(bundle))
                    {
                        newData.parents.Add(parents);
                    }
                    newData.bundleHashCode = ABM.GetAssetBundleHash(bundle).ToString();


                    //读取文件大小
                    if (File.Exists(bundlebasepath + "/" + bundle))
                    {
                        FileInfo tmpfi = new FileInfo(bundlebasepath + "/" + bundle);
                        newData.size = tmpfi.Length;
                    }
                    else
                    {
                        UnityEngine.Debug.LogError("Can not find " + bundlebasepath + "/" + bundle);
                    }

                    AllBundleData.Add(newData);
                }
            }

            //写成txt
            string targetpath = manifestpath + "/bm.data";

            string writestr = JsonFormatter.PrettyPrint(JsonMapper.ToJson(AllBundleData));

            FileSystem.ReplaceFile(targetpath, writestr);

            AssetDatabase.Refresh();
        }