Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }