概要
using UnityEditor; using UnityEditor.AddressableAssets.Build; using UnityEngine; [InitializeOnLoad] public static class Example { static Example() { BuildScript.buildCompleted += OnBuildCompleted; } private static void OnBuildCompleted( AddressableAssetBuildResult result ) { Debug.Log( $"Duration: {result.Duration}" ); Debug.Log( $"LocationCount: {result.LocationCount}" ); Debug.Log( $"Error: {result.Error}" ); Debug.Log( $"OutputPath: {result.OutputPath}" ); Debug.Log( "FileRegistry.GetFilePaths:" ); foreach ( var filePath in result.FileRegistry.GetFilePaths() ) { Debug.Log( filePath ); } } }
- 例えば faster モードで Unity を再生して settings や catalog の .json が作られる時に呼び出される
- アセットバンドルをビルドする時にも呼び出される