AssetBundles.AssetBundleManager.GetStreamingAssetsPath C# (CSharp) Method

GetStreamingAssetsPath() private static method

private static GetStreamingAssetsPath ( ) : string
return string
        private static string GetStreamingAssetsPath()
        {
            if (Application.isEditor)
                return "file://" +  System.Environment.CurrentDirectory.Replace("\\", "/"); // Use the build output folder directly.
            else if (Application.isWebPlayer)
                return System.IO.Path.GetDirectoryName(Application.absoluteURL).Replace("\\", "/")+ "/StreamingAssets";
            else if (Application.isMobilePlatform || Application.isConsolePlatform)
                return Application.streamingAssetsPath;
            else // For standalone player.
                return "file://" +  Application.streamingAssetsPath;
        }

Usage Example

Exemplo n.º 1
0
 public static void SetSourceAssetBundleDirectory(string relativePath)
 {
     AssetBundleManager.BaseDownloadingURL = AssetBundleManager.GetStreamingAssetsPath() + relativePath;
 }