public static bool CopyToStreamingAssets(string platform, ResourceEditorTargetCopyOptions copyOptions, ConfigDataConfigurator configDataConfigurator, AssetBundleConfigurator assetBundleConfigurator) { var configData = configDataConfigurator.LoadConfigData(platform); if (configData == null) { return(false); } // options var rootDirectory = ResourceStreamingLocation.FullRootPath; if (copyOptions.ClearFolders) { var platformRootDirectory = Path.Combine(rootDirectory, platform); ResourceEditorHelper.ClearDirectory(platformRootDirectory); } if (copyOptions.ClearOtherPlatforms) { DeleteOtherPlatformDirectory(ResourceStreamingLocation.FullRootPath, platform); } // copy config var result = configDataConfigurator.CopyConfigToTarget(platform); // config asset bundles var locationDatas = configData.LocationDatas; result &= assetBundleConfigurator.CopyAssetBundlesToStreamingTarget(locationDatas, platform); return(result); }
private void CopyResourceToStreamingAssets(string targetPlatform) { var configDataConfigurator = new ConfigDataConfigurator(); var assetBundleConfigurator = new AssetBundleConfigurator(); var copyOptions = new ResourceEditorTargetCopyOptions { ClearFolders = true, ClearOtherPlatforms = true }; ResourceEditorWindow.CopyToStreamingAssets(targetPlatform, copyOptions, configDataConfigurator, assetBundleConfigurator); }