Beispiel #1
0
        public object Clone()
        {
            KAssetBundle ab = this.MemberwiseClone()  as KAssetBundle;

            ab.m_bCloned = true;
            return(ab);
        }
Beispiel #2
0
        public string[] GetAllAssetNames()
        {
            KAssetBundle ab = Res;

            if (ab == null)
            {
                return(null);
            }
            return(ab.GetAllAssetNames());
        }
 protected AssetBundleCreateRequest LoadFullAssetToMemAsync(BundlePkgInfo pkginfo)
 {
     if (Application.isPlaying && MainLoop.getInstance())
     {
         return(KAssetBundle.LoadFromFileAsync(BundlePathConvert.GetRunningPath(pkginfo.AbFileName)));;
     }
     else
     {
         return(null);
     }
 }
Beispiel #4
0
        public bool Equals(KAssetBundle other)
        {
            if (other == null)
            {
                return(false);
            }

            if (this.assetbundle == null && other.assetbundle == null)
            {
                return(true);
            }

            return(this.assetbundle == other.assetbundle);
        }
Beispiel #5
0
        private void Dispose()
        {
            for (int i = 0; i < this.depends.Count; ++i)
            {
                this.depends[i].Release();
            }

            this.refs.Clear();
            this.depends.Clear();
            this.LoadName = null;
            this.Res      = null;
            this.refs     = null;
            this.depends  = null;
        }
Beispiel #6
0
        private KAssetBundle TryGetPtr(string abname, AssetBundle ab)
        {
            KAssetBundle ptr = null;

            if (this.ptrcaches.ContainsKey(abname))
            {
                return(this.ptrcaches[abname]);
            }

            ptr = new KAssetBundle(ab);
            this.ptrcaches[abname] = ptr;

            return(ptr);
        }
        protected AssetBundle LoadAssetBundle(string path)
        {
            if (MainLoop.getInstance().OpenABMode)
            {
#if UNITY_IOS || UNITY_IPHONE || UNITY_ANDROID
                AssetBundle ab = KAssetBundle.LoadFromFile(path);
                return(ab);
#else
                return(null);
#endif
            }
            else
            {
                return(null);
            }
        }
Beispiel #8
0
        public static BundleRef  Create(KAssetBundle ab, string abname, string loadname, string bundlename)
        {
            BundleRef bundle = new BundleRef();

            bundle.Res = ab;

            bundle.depends = new List <IBundleRef>();
            bundle.refs    = new List <WeakReference>();

            if (ab.isStreamedSceneAssetBundle)
            {
                bundle.LoadName = System.IO.Path.GetFileNameWithoutExtension(ab.GetAllScenePaths()[0]);
            }
            else
            {
                bundle.LoadName = BundlePathConvert.EditorName2AssetName(loadname);
            }

            bundle.name     = bundlename;
            bundle.filename = abname;
            return(bundle);
        }