Exemple #1
0
        private void LoadTex(AssetBundleRequest abr, System.Object param)
        {
            if (abr == null)
            {
                return;
            }
            textures = abr.asset as StringContentHolder;

            ResLoader.HelpLoadAsset(assetBundle, "rendererobject", LoadCallback, null, typeof(GameObject));
        }
Exemple #2
0
        private void LoadBone(AssetBundleRequest abr, System.Object param)
        {
            if (abr == null)
            {
                return;
            }
            boneName = abr.asset as StringContentHolder;

            if (pack)
            {
                ResLoader.HelpLoadAsset(assetBundle, "textures", LoadTex, null, typeof(StringContentHolder));
            }
            else
            {
                ResLoader.HelpLoadAsset(assetBundle, "rendererobject", LoadCallback, null, typeof(GameObject));
            }
        }
Exemple #3
0
        public void OnDestroy()
        {
            try
            {
                if (assetBundle != null)
                {
                    assetBundle.Unload(true);
                    assetBundle = null;
                }

                Object.Destroy(gameObject);
                gameObject = null;

                ResLoader.Unload(goAsset);
                boneName = null;
                textures = null;

                ResLoader.RemoveAssetCacheByName(name, true, true);
            }
            catch (System.Exception e)
            {
                Debug.LogError("unload asset failed->" + e.ToString());
            }
        }