Method CreateGroup
CreateGroup(string, bool, bool, bool, List<AddressableAssetGroupSchema>, params Type[])
Creates a new Addressable Asset group.
Declaration
public AddressableAssetGroup CreateGroup(string groupName, bool setAsDefaultGroup, bool readOnly, bool postEvent, List<AddressableAssetGroupSchema> schemasToCopy, params Type[] types)
Parameters
Type | Name | Description |
---|---|---|
string | groupName | The name of the Addressable Asset group. |
bool | setAsDefaultGroup | Whether to set the new group as the default Addressable Asset group. |
bool | readOnly | Whether to set the the group as viewable but not modifiable. Otherwise, the group can be modified. |
bool | postEvent | Whether to generate an event when the group is created. Otherwise, no event is created. |
List<Addressable |
schemasToCopy | The list of group schemas to add to the created group. |
Type[] | types | The types of schemas to create and add to the created group. |
Returns
Type | Description |
---|---|
Addressable |
The newly created Addressable Asset group. |
Remarks
Use schemasToCopy to copy schemas with custom values, for example schemas from an existing Addressable Asset group. Pass in schema types to add schemas with default values.
Examples
public AddressableAssetGroup CreateNewGroup()
{
AddressableAssetSettings settings = AddressableAssetSettingsDefaultObject.Settings;
AddressableAssetGroup group = settings.CreateGroup("MyNewGroup", false, false, false, null, typeof(BundledAssetGroupSchema), typeof(ContentUpdateGroupSchema));
return group;
}