Beispiel #1
0
        private IEnumerator CreateAssetBundleReference(string bundlePath, PYBundlePriority priority)
        {
            DirectoryInfo dir  = new DirectoryInfo(bundlePath);
            BundleData    data = Bundles[priority].Find((t) => dir.Parent.Name == t.Name);

            if (data == null)
            {
                data = new BundleData(dir.Parent.Name.Split('.')[0]);
                Bundles[priority].Add(data);
            }

            AssetBundleCreateRequest bundleRequest = AssetBundle.LoadFromFileAsync(bundlePath);

            yield return(bundleRequest);

            data.Bundles.Add(bundleRequest.assetBundle);
            data.AbsoluteBundlePaths.Add(bundlePath);

            if (bundleRequest.assetBundle != null)
            {
                // Load PYBundleVersion for this bundleData
                TextAsset versionFile = bundleRequest.assetBundle.LoadAsset <TextAsset>("version");
                if (versionFile == null)
                {
                    Debug.LogWarning(string.Format("PYBUNDLE ({0}): Reading bundle ({1}) version.xml file not found!",
                                                   this.ToString().Replace("PYBundleSystem.", ""), data.Name));
                }
                else
                {
                    data.Version = PYXML.DeserializerFromContent <PYBundleVersion>(versionFile.text);

                    // Debug for unity output file
#if !UNITY_EDITOR
                    Debug.LogWarning(string.Format("PYBUNDLE ({0}): Reading bundle ({1}) version: ({2}) creationDate: ({3}) isReadable/Uptodate: ({4})",
                                                   this.ToString().Replace("PYBundleSystem.", ""), data.Name, data.Version.Version, data.Version.CreationDate, data.Version.IsReadable));
#endif
                }
            }
        }
Beispiel #2
0
 public virtual bool ExistTag <T>(PYBundlePriority priority, PYBundleTags assetTag)
 {
     return(ExistAsset(assetTag.ToStringTag()));
 }
Beispiel #3
0
 public virtual bool ExistTag <T>(PYBundlePriority priority, string assetTag)
 {
     return(ExistAsset(assetTag));
 }