浏览代码

make incrmeental buildpipeline pick up addressable assets

/incrementalpipeline2
Lucas Meijer 5 年前
当前提交
c0ae5b9c
共有 6 个文件被更改,包括 67 次插入0 次删除
  1. 8
      Assets/IncrementalPipelineSupport.meta
  2. 23
      Assets/IncrementalPipelineSupport/AddressableFilesProvider.cs
  3. 11
      Assets/IncrementalPipelineSupport/AddressableFilesProvider.cs.meta
  4. 18
      Assets/IncrementalPipelineSupport/IncrementalPipelineSupport.asmdef
  5. 7
      Assets/IncrementalPipelineSupport/IncrementalPipelineSupport.asmdef.meta

8
Assets/IncrementalPipelineSupport.meta


fileFormatVersion: 2
guid: 84a25b9711507b140b981b35c2f5a63a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

23
Assets/IncrementalPipelineSupport/AddressableFilesProvider.cs


using System.IO;
using System.Linq;
using Unity.Build.Classic;
using UnityEngine.AddressableAssets;
public class AddressableFilesProvider : AdditionalFilesProviderBase
{
protected override void OnPrepareAdditionalAssetsBeforeBuild()
{
if (!Directory.Exists(Addressables.BuildPath))
return;
var buildPath = Addressables.BuildPath;
var relativeRoot = Path.GetDirectoryName(Path.GetDirectoryName(buildPath));
var fileToCopies = Directory.GetFiles(buildPath, "*.*", SearchOption.AllDirectories).ToArray();
foreach (var fileToCopy in fileToCopies)
{
var relative = fileToCopy.Substring(relativeRoot.Length+1);
var targetFile = $"{StreamingAssetsDirectory}/{relative}";
AddFile(fileToCopy, targetFile);
}
}
}

11
Assets/IncrementalPipelineSupport/AddressableFilesProvider.cs.meta


fileFormatVersion: 2
guid: fbf20bc7f77cf1a47987c5805bd1e35b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

18
Assets/IncrementalPipelineSupport/IncrementalPipelineSupport.asmdef


{
"name": "IncrementalPipelineSupport",
"references": [
"Unity.Build.Classic",
"Unity.Addressables.Editor",
"Unity.Addressables"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"noEngineReferences": false
}

7
Assets/IncrementalPipelineSupport/IncrementalPipelineSupport.asmdef.meta


fileFormatVersion: 2
guid: 489f93d75f914b44b8295270b197317c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存