/// <summary> /// Calls Play Core to get the location of the specified asset within the specified asset pack. /// </summary> /// <returns> /// The AssetLocation of the specified asset or null if the most up-to-date /// version of this asset pack isn't available on disk. /// </returns> public AssetLocation GetAssetLocation(string assetPackName, string assetPath) { Debug.LogFormat("Calling get asset location, assetPackName: {0}, path: {1}", assetPackName, assetPath); var javaAssetLocation = _javaAssetPackManager.Call <AndroidJavaObject>("getAssetLocation", assetPackName, assetPath); return(PlayCoreHelper.IsNull(javaAssetLocation) ? null : new AssetLocation(javaAssetLocation)); }
private Dictionary <string, AssetPackState> ConvertPackStatesJavaMapToDictionary( AndroidJavaObject packStates) { using (var javaMap = packStates.Call <AndroidJavaObject>("packStates")) { return(PlayCoreHelper.ConvertJavaMap <string, AndroidJavaObject>(javaMap) .ToDictionary(kvp => kvp.Key, kvp => new AssetPackState(kvp.Value))); } }
/// <summary> /// Creates an AssetPackLocation with all the fields of the underlying Java object, disposing the Java /// object in the process. /// </summary> public AssetPackLocation(AndroidJavaObject packLocation) { using (packLocation) { // Called with AndroidJavaObject instead of string because path may be null. var javaPathString = packLocation.Call <AndroidJavaObject>("path"); Path = PlayCoreHelper.ConvertJavaString(javaPathString); PackStorageMethod = (AssetPackStorageMethod)packLocation.Call <int>("packStorageMethod"); } }
/// <summary> /// Calls Play Core to get the location of the specified asset pack. /// This should contain the AssetBundle associated with the specified asset pack. /// </summary> /// <returns> /// The AssetPackLocation containing the contents of the specified asset pack, or null if the most up-to-date /// version of this asset pack isn't available on disk. /// </returns> public AssetPackLocation GetPackLocation(string assetPackName) { var javaPackLocation = _javaAssetPackManager.Call <AndroidJavaObject>("getPackLocation", assetPackName); return(PlayCoreHelper.IsNull(javaPackLocation) ? null : new AssetPackLocation(javaPackLocation)); }