Unity_Addressable_Modification events
Modification events are used to signal to parts of the Addressables system when certain data is manipulated, such as an AddressableAssetGroup
or an AddressableAssetEntry
getting added or removed.
译:修改事件用于向Addressables系统的某些部分发出信号,以指示特定数据是否被操作,例如添加或删除AddressableAssetGroup或AddressableAssetEntry。
Modification events are triggered as part of SetDirty
calls inside of Addressables. SetDirty
is used to indicate when an asset needs to be re-serialized by the AssetDatabase
. As part of this SetDirty
, two modification event callbacks can trigger:
译:修改事件作为Addressables中SetDirty调用的一部分触发。 SetDirty用于指示需要重新序列化AssetDatabase的资产。作为SetDirty的一部分,可以触发两个修改事件回调:
which can be found on AddressableAssetSettings
through a static, or instance, accessors respectively.
译:可以通过静态或实例访问器在AddressableAssetSettings中找到它们。
Code Samples
Modification events pass in a generic object
for the data associated with the event. Below is a list of the modification events and the data types that are passed with them.
译:修改事件传入与事件相关联的通用对象。以下是修改事件及其传递的数据类型列表。
The Data Passed with Each ModificationEvent:
GroupAdded The data passed with this event is the
AddressableAssetGroup
, or list of groups, that were added.译:GroupAdded 传递的数据是添加的AddressableAssetGroup或组列表。GroupRemoved The data passed with this event is the
AddressableAssetGroup
, or list of groups, that were removed.译:GroupRemoved 传递的数据是已删除的AddressableAssetGroup或组列表。GroupRenamed The data passed with this event is the
AddressableAssetGroup
, or list of groups, that were renamed.译:GroupRenamed 传递的数据是已重命名的AddressableAssetGroup或组列表。GroupSchemaAdded The data passed with this event is the
AddressableAssetGroup
, or list of groups, that had schemas added to them.译:GroupSchemaAdded 传递的数据是已向其添加模式的AddressableAssetGroup或组列表。GroupSchemaRemoved The data passed with this event is the
AddressableAssetGroup
, or list of groups, that had schemas removed from them.译:GroupSchemaRemoved 传递的数据是从中删除模式的AddressableAssetGroup或组列表。GroupSchemaModified The data passed with this event is the
AddressableAssetGroupSchema
that was modified.译:GroupSchemaModified 传递的数据是已修改的AddressableAssetGroupSchema。GroupTemplateAdded The data passed with this event is the
ScriptableObject
, typically one that implementsIGroupTemplate
, that was the added Group Template object.译:GroupTemplateAdded 传递的数据是已添加的ScriptableObject,通常实现了IGroupTemplate的Group Template对象。GroupTemplateRemoved The data passed with this event is the
ScriptableObject
, typically one that implementsIGroupTemplate
, that was the removed Group Template object.译:GroupTemplateRemoved 传递的数据是已删除的ScriptableObject,通常实现了IGroupTemplate的Group Template对象。GroupTemplateSchemaAdded The data passed with this event is the
AddressableAssetGroupTemplate
that had a schema added.译:GroupTemplateSchemaAdded 传递的数据是已添加其模式的AddressableAssetGroupTemplate。GroupTemplateSchemaRemoved The data passed with this event is the
AddressableAssetGroupTemplate
that had a schema removed.译:GroupTemplateSchemaRemoved 传递的数据是已删除其模式的AddressableAssetGroupTemplate。EntryCreated The data passed with this event is the
AddressableAssetEntry
that was created.译:EntryCreated 传递的数据是已创建的AddressableAssetEntry。EntryAdded The data passed with this event is the
AddressableAssetEntry
, or list of entries, that were added.译:EntryAdded 传递的数据是已添加的AddressableAssetEntry或条目列表。EntryMoved The data passed with this event is the
AddressableAssetEntry
, or list of entries, that were moved from one group to another.译:EntryMoved 传递的数据是已从一个组移动到另一个组的AddressableAssetEntry或条目列表。EntryRemoved The data passed with this event is the
AddressableAssetEntry
, or list of entries, that were removed.译:EntryRemoved 传递的数据是已删除的AddressableAssetEntry或条目列表。LabelAdded The data passed with this event is the
string
label that was added.译:LabelAdded 传递的数据是已添加的字符串标签LabelRemoved The data passed with this event is the
string
label that was removed.译:LabelRemoved 传递的数据是已删除的字符串标签。ProfileAdded The data passed with this event is [
BuildProfile
] that was added.译:ProfileAdded 传递的数据是已添加的[BuildProfile]。ProfileRemoved The data passed with this event is the
string
of the profile ID that was removed.译:ProfileRemoved 传递的数据是已删除的配置文件ID的字符串。ProfileModified The data passed with this event is [
BuildProfile
] that was modified, ornull
if a batch ofBuildProfiles
were modified.译:ProfileModified 传递的数据是已修改的[BuildProfile],如果批量修改了BuildProfiles,则为null。ActiveProfileSet The data passed with this event if the
string
of the profile ID that is set as the active profile.译:ActiveProfileSet 如果设置了活动配置文件,则传递的数据为空串的配置文件ID。EntryModified The data passed with this event is the
AddressableAssetEntry
, or list of entries, that were modified.译:EntryModified 传递的数据是已修改的AddressableAssetEntry或条目列表。BuildSettingsChanged The data passed with this event is the
AddressableAssetBuildSettings
object that was modified.译:BuildSettingsChanged 传递的数据是已修改的AddressableAssetBuildSettings对象。ActiveBuildScriptChanged The data passed with this event is the
IDataBuilder
build script that was set as the active builder.译:ActiveBuildScriptChanged 传递的数据是设置为活动构建器的IDataBuilder构建脚本。DataBuilderAdded The data passed with this event is the
ScriptableObject
, typically one that implementsIDataBuilder
, that was added to the list of DataBuilders.译:DataBuilderAdded 传递的数据是已添加到DataBuilders列表中的ScriptableObject,通常实现了IDataBuilder。DataBuilderRemoved The data passed with this event is the
ScriptableObject
, typically one that implementsIDataBuilder
, that was removed from the list of DataBuilders.译:DataBuilderRemoved 传递的数据是从DataBuilders列表中删除的ScriptableObject,通常实现了IDataBuilder。InitializationObjectAdded The data passed with this event is the
ScriptableObject
, typically one that implementsIObjectInitializationDataProvider
, that was added to the list of InitializationObjects.译:InitializationObjectAdded 传递的数据是已添加到InitializationObjects列表中的ScriptableObject,通常实现了IObjectInitializationDataProvider。InitializationObjectRemoved The data passed with this event is the
ScriptableObject
, typically one that implementsIObjectInitializationDataProvider
, that was removed from the list of InitializationObjects.译:InitializationObjectRemoved 传递的数据是从InitializationObjects列表中删除的ScriptableObject,通常实现了IObjectInitializationDataProvider。ActivePlayModeScriptChanged The data passed with this event is the
IDataBuilder
that was set as the new active play mode data builder.译:ActivePlayModeScriptChanged 传递的数据是设置为新的活动播放模式数据构建器的IDataBuilder。BatchModification The data passed with this event is
null
. This event is primarily used to indicate several modification events happening at the same time and theAddressableAssetSettings
object needed to be marked dirty.译:BatchModification 传递的数据为空。此事件主要用于指示同时发生多个修改事件,并且需要将AddressableHostingServicesManagerModified The data passed is either going to be the
HostingServicesManager
, or theHttpHostingService
that were modified.译:HostingServicesManagerModified 传递的数据可能是已修改的 HostServicesManager 或 HttpHostingService。GroupMoved The data passed with this event is the full list of
AddressableAssetGroups
.译:GroupMoved 此事件传递的数据是 AddressableAssetGroups 的完整列表。CertificateHandlerChanged The data passed with this event is the new
System.Type
of the Certificate Handler to be used.译:CertificateHandlerChanged 此事件传递的数据是要使用的新证书处理程序的 System.Type。