Beispiel #1
0
        public virtual bool VersionExists()
        {
            BundleBuilder builder       = new BundleBuilder();
            string        versionOutput = builder.GetVersionOutput(this.OutputPath, this.BuildTarget, this.DataVersion);

            return(Directory.Exists(versionOutput));
        }
Beispiel #2
0
        public virtual void CopyToStreamingAssets()
        {
            try
            {
                AssetDatabase.StartAssetEditing();
                BundleBuilder builder = new BundleBuilder();

                DirectoryInfo src  = new DirectoryInfo(builder.GetVersionOutput(this.OutputPath, this.BuildTarget, this.DataVersion));
                DirectoryInfo dest = new DirectoryInfo(BundleUtil.GetReadOnlyDirectory());

                if (dest.Exists)
                {
                    dest.Delete(true);
                }
                if (!dest.Exists)
                {
                    dest.Create();
                }

                BundleManifest manifest = builder.CopyAssetBundleAndManifest(src, dest);
                if (manifest != null)
                {
                    Debug.LogFormat("Copy AssetBundles success.");
                }

                AssetDatabase.Refresh();
            }
            catch (Exception e)
            {
                Debug.LogFormat("Copy AssetBundles failure. Error:{0}", e);
            }
            finally
            {
                AssetDatabase.StopAssetEditing();
            }
        }