using UnityEngine; using System.Collections; public class AssetBundleUtils { const string ASSET_BUNDLES_BASE_URL = "https://game.gamatic.com/app_condom_dk/AssetBundles/"; public static string GetAssetBundlesURL() { #if UNITY_EDITOR //For editor use local version of WebPlayer return "file://"+ AssetBundleUtils.GetLocalAssetBundlesDestPath() + "WebPlayer"; #else return AssetBundleUtils.ASSET_BUNDLES_BASE_URL + AssetBundleUtils.GetBuildTargetPrefix(); #endif } public static string GetLocalAssetBundlesDestPath() { return Application.dataPath.Substring(0, Application.dataPath.LastIndexOf("Asset")) + "AssetBundles/"; } /// /// Return the string that matches with the BuildTarget enum used when building the assetbundles /// public static string GetBuildTargetPrefix() { #if UNITY_IPHONE return "iPhone"; #elif UNITY_ANDROID return "Android"; #elif UNITY_WEBPLAYER return "WebPlayer"; #else Debug.LogError("Selected platform not supported"); return null; #endif } }