Skip to content

Commit

Permalink
feat: force add schema from template to rule target group (#65)
Browse files Browse the repository at this point in the history
* Add force add schema from template group to the target group

* Comment out test code

* remove forceAddSchemaFromTemplate bool, always run check and add schema before apply template to group
  • Loading branch information
JVinceW authored Dec 25, 2022
1 parent bbd9ac7 commit d553499
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Editor/AddressableImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,13 @@ static AddressableAssetEntry CreateOrUpdateAddressableAssetEntry(
}

// Set group settings from template if necessary
if (rule.groupTemplate != null && (newGroup || rule.groupTemplateApplicationMode == GroupTemplateApplicationMode.AlwaysOverwriteGroupSettings))
{
if (rule.groupTemplate != null && (newGroup || rule.groupTemplateApplicationMode ==
GroupTemplateApplicationMode.AlwaysOverwriteGroupSettings)) {
var templateSchema = rule.groupTemplate.SchemaObjects;
foreach (var schema in templateSchema.Where(schema => !group.HasSchema(schema.GetType())))
{
group.AddSchema(schema.GetType());
}
rule.groupTemplate.ApplyToAddressableAssetGroup(group);
}

Expand Down

0 comments on commit d553499

Please sign in to comment.