| Parameter | Description |
|---|---|
| assetPackName | The name of the Android asset pack to remove. |
Removes the specified Android asset pack from the device.
This method directly wraps Google's PlayCore plug-in API. If the PlayCore plug-in is missing, calling this method throws an InvalidOperationException.
If you call this method with any core Unity asset pack names that AndroidAssetPacks.GetCoreUnityAssetPackNames returns as a parameter, the method has no effect.
Additional resources: AndroidAssetPacks.DownloadAssetPackAsync.
using UnityEngine; using UnityEngine.Android;
public class RemoveAssetPackExample : MonoBehaviour { // Call this method to remove an on-demand asset pack that is no longer needed. public void RemoveCustomAssetPack(string assetPackName) { var path = AndroidAssetPacks.GetAssetPackPath(assetPackName); if (string.IsNullOrEmpty(path)) { Debug.Log($"{assetPackName}: Asset pack is not installed."); return; }
AndroidAssetPacks.RemoveAssetPack(assetPackName); Debug.Log($"Removed asset pack: {assetPackName}"); } }