Esempio n. 1
0
        public object[] RunScript(string scriptAssetpath)
        {
            TextAsset luaText = ABResources.Load <TextAsset>(scriptAssetpath);

            //Debug.LogFormat("LuaVM RunScript luaText:\n{0}", luaText.text);
            return(DoString(luaText.bytes, scriptAssetpath));
        }
Esempio n. 2
0
 public LuaVM()
 {
     this.AddLoader((ref string filepath) =>
     {
         //Debug.LogFormat("LuaVM Load filepath:{0}", filepath);
         TextAsset luaText = ABResources.Load <TextAsset>(filepath);
         //Debug.LogFormat("LuaVM Load file content:\n{0}", luaText.text);
         return(luaText.bytes);
     });
 }
Esempio n. 3
0
        public static void MarkAllAssetBundles()
        {
            var assetFiles       = Directory.GetFiles(assetBundleResourceFolder, "*", SearchOption.AllDirectories);
            var assetFilesToBeAB = assetFiles.Where(f => !f.EndsWith(".meta"))
                                   .Where(f => !f.EndsWith(".cs"));

            //make sure the path is assetPath(path are relative to the project folder, and path is sperated by "/", for example: "Assets/MyTextures/hello.png").
            assetFilesToBeAB = assetFilesToBeAB.Select(path => path.Replace("\\", "/"));
            Debug.LogFormat("assetFilesToBeAB:\n{0}", string.Join("\n", assetFilesToBeAB.ToArray()));
            foreach (string assetPath in assetFilesToBeAB)
            {
                var assetImp = AssetImporter.GetAtPath(assetPath);
                if (assetImp != null)
                {
                    assetImp.assetBundleName = ABResources.AssetPathToAssetBundleName(assetPath);
                }
            }
        }