Class GroupResolver
Provides support for placing assets into different AddressableAssetGroups.
Namespace: UnityEditor.Localization.Addressables
Syntax
[Serializable]
public class GroupResolver
Constructors
GroupResolver()
Creates a new default instance of GroupResolver.
Declaration
public GroupResolver()
GroupResolver(String)
Creates a new instance which will store all assets into a single group.
Declaration
public GroupResolver(string groupName)
Parameters
Type | Name | Description |
---|---|---|
String | groupName | The name to use when creating a new group. |
GroupResolver(String, String)
Creates an instance using custom group names for each Locale.
Declaration
public GroupResolver(string localeGroupNamePattern, string sharedGroupName)
Parameters
Type | Name | Description |
---|---|---|
String | localeGroupNamePattern | The name to use when creating a new Group for a selected LocaleIdentifier. The name is formatted using Smart where the argument passed will be the LocaleIdentifier. The default is |
String | sharedGroupName | The name of the group to use when an asset is shared by multiple Locales that do not all use the same group. |
GroupResolver(AddressableAssetGroup)
Creates a new instance which will store all assets into a single group;
Declaration
public GroupResolver(AddressableAssetGroup group)
Parameters
Type | Name | Description |
---|---|---|
AddressableAssetGroup | group | The group to use. |
Properties
LocaleGroupNamePattern
The name to use when generating a new AddressableAssetGroup for a LocaleIdentifier.
Declaration
public string LocaleGroupNamePattern { get; set; }
Property Value
Type | Description |
---|---|
String |
MarkEntriesReadOnly
Should new Entries be marked as read only? This will prevent editing them in the Addressables window.
Declaration
public bool MarkEntriesReadOnly { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
SharedGroup
The group to use for shared assets. If null then a new group will be created using SharedGroupName.
Declaration
public AddressableAssetGroup SharedGroup { get; set; }
Property Value
Type | Description |
---|---|
AddressableAssetGroup |
SharedGroupName
The name to use when creating a new group.
Declaration
public string SharedGroupName { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
AddLocaleGroup(LocaleIdentifier, AddressableAssetGroup)
Add a group for the LocaleIdentifier. If a Group is already assigned it will be replaced with the new group.
Declaration
public void AddLocaleGroup(LocaleIdentifier identifier, AddressableAssetGroup group)
Parameters
Type | Name | Description |
---|---|---|
LocaleIdentifier | identifier | The Locale Id to use for the selected group. |
AddressableAssetGroup | group | The group to add for the selected Locale Id, must not be |
AddToGroup(Object, IList<LocaleIdentifier>, AddressableAssetSettings, Boolean)
Add an asset to an AddressableAssetGroup. The asset will be moved into a group which either matches SharedGroup or SharedGroupName.
Declaration
public virtual AddressableAssetEntry AddToGroup(Object asset, IList<LocaleIdentifier> locales, AddressableAssetSettings aaSettings, bool createUndo)
Parameters
Type | Name | Description |
---|---|---|
Object | asset | The asset to be added to a group. |
IList<LocaleIdentifier> | locales | List of locales that depend on this asset or null if the asset is used by all. |
AddressableAssetSettings | aaSettings | The Addressables setting that will be used if a new group should be added. |
Boolean | createUndo | Should an Undo record be created? |
Returns
Type | Description |
---|---|
AddressableAssetEntry | The asset entry for the added asset. |
GetExpectedGroupName(IList<LocaleIdentifier>, Object, AddressableAssetSettings)
Returns the name of the group that the asset will be moved to when calling AddToGroup(Object, IList<LocaleIdentifier>, AddressableAssetSettings, Boolean).
Declaration
public virtual string GetExpectedGroupName(IList<LocaleIdentifier> locales, Object asset, AddressableAssetSettings aaSettings)
Parameters
Type | Name | Description |
---|---|---|
IList<LocaleIdentifier> | locales | |
Object | asset | |
AddressableAssetSettings | aaSettings |
Returns
Type | Description |
---|---|
String |
GetExpectedSharedGroupName(IList<LocaleIdentifier>, Object, AddressableAssetSettings)
Returns the name that the Shared group is expected to have.
Declaration
protected virtual string GetExpectedSharedGroupName(IList<LocaleIdentifier> locales, Object asset, AddressableAssetSettings aaSettings)
Parameters
Type | Name | Description |
---|---|---|
IList<LocaleIdentifier> | locales | |
Object | asset | |
AddressableAssetSettings | aaSettings |
Returns
Type | Description |
---|---|
String |
GetGroup(IList<LocaleIdentifier>, Object, AddressableAssetSettings, Boolean)
Returns the Addressable group for the asset.
Declaration
protected virtual AddressableAssetGroup GetGroup(IList<LocaleIdentifier> locales, Object asset, AddressableAssetSettings aaSettings, bool createUndo)
Parameters
Type | Name | Description |
---|---|---|
IList<LocaleIdentifier> | locales | The locales that depend on the asset. |
Object | asset | The asset that is to be added to an Addressable group. |
AddressableAssetSettings | aaSettings | The Addressable asset settings. |
Boolean | createUndo | Should an Undo record be created if changes are made? |
Returns
Type | Description |
---|---|
AddressableAssetGroup |
GetLocaleGroup(LocaleIdentifier)
Returns the active group assigned to the LocaleIdentifier or null
if one has not been assigned.
Declaration
public AddressableAssetGroup GetLocaleGroup(LocaleIdentifier identifier)
Parameters
Type | Name | Description |
---|---|---|
LocaleIdentifier | identifier | The Locale Id to search for. |
Returns
Type | Description |
---|---|
AddressableAssetGroup |
RemoveLocaleGroup(LocaleIdentifier)
Removes the group for the chosen Locale Id.
Declaration
public bool RemoveLocaleGroup(LocaleIdentifier identifier)
Parameters
Type | Name | Description |
---|---|---|
LocaleIdentifier | identifier | The Locale Id to be removed. |
Returns
Type | Description |
---|---|
Boolean | Returns |