28 lines
798 B
C#
Raw Normal View History

2025-05-18 01:04:31 +08:00
namespace AddressableAssets.DocExampleCode
{
#region SAMPLE
#if (UNITY_EDITOR && ENABLE_CCD)
using System.Threading.Tasks;
using UnityEditor.AddressableAssets.Build;
public class BuildHooks
{
static void AddBuildHook()
{
CcdBuildEvents.PrependPreBuildEvent(PrintBucketInformation);
CcdBuildEvents.PrependPreUpdateEvent(PrintBucketInformation);
}
static async Task<bool> PrintBucketInformation(AddressablesDataBuilderInput input)
{
UnityEngine.Debug.Log($"Environment: {CcdManager.EnvironmentName}");
UnityEngine.Debug.Log($"Bucket: {CcdManager.BucketId}");
UnityEngine.Debug.Log($"Badge: {CcdManager.Badge}");
return true;
}
}
#endif
#endregion
}