예제 #1
0
        public void ButtonEventRemoveAssetBundle()
        {
            var removeOperation = PlayAssetDelivery.RemoveAssetPack(AssetBundleName);

            removeOperation.Completed += (operation) =>
            {
                if (operation.Error != AssetDeliveryErrorCode.NoError)
                {
                    Debug.LogErrorFormat("Error removing AssetBundle {0}: {1}", AssetBundleName, operation.Error);
                    return;
                }

                SetInitialStatus();
                UnloadAssetBundle();
            };
        }
        /// <summary>
        /// Remove all asset packs specified in <see cref="Assets"/>.
        /// </summary>
        public void ButtonEventRemovePacks()
        {
            // Defensive check. In practice this should never occur because the remove button is only shown once the
            // batch request is initialized.
            if (_batchRequest == null)
            {
                return;
            }

            foreach (var asset in Assets)
            {
                PlayAssetDelivery.RemoveAssetPack(asset.AssetPackName);
            }

            SetInitialStatus();
        }