12345678910111213141516171819202122232425262728293031323334353637383940 |
- 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/";
- }
-
- /// <returns>
- /// Return the string that matches with the BuildTarget enum used when building the assetbundles
- /// </returns>
- 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
- }
-
- }
|