Skip to content

Commit

Permalink
Feature/add costume support (#301)
Browse files Browse the repository at this point in the history
Feature/add costume support (#301)
  • Loading branch information
HarrisonHough authored Jun 26, 2024
1 parent e8183a1 commit a5c1320
Show file tree
Hide file tree
Showing 8 changed files with 951 additions and 862 deletions.
4 changes: 3 additions & 1 deletion Runtime/AvatarCreator/Scripts/Data/AssetType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public enum AssetType
Footwear,
[AssetTypeFilter(AssetFilter.Template)]
AvatarTemplate,
BodyShape
BodyShape,
[AssetTypeFilter(AssetFilter.Style)]
Costume
}

public enum AssetFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static bool IsOptionalAsset(this AssetType assetType)
case AssetType.Outfit:
case AssetType.Shirt:
case AssetType.EyebrowStyle:
case AssetType.Costume:
return false;
default:
return !assetType.IsColorAsset();
Expand Down
3 changes: 2 additions & 1 deletion Runtime/AvatarCreator/Scripts/Managers/AvatarManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ public async Task<GameObject> UpdateAsset(AssetType assetType, object assetId)
{
payload.Assets.Add(AssetType.Outfit, string.Empty);
}
// Convert costume to outfit
payload.Assets.Add(assetType == AssetType.Costume ? AssetType.Outfit : assetType, assetId);

payload.Assets.Add(assetType, assetId);
byte[] data;
try
{
Expand Down
3 changes: 2 additions & 1 deletion Runtime/AvatarCreator/Scripts/Utils/CategoryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public static IEnumerable<AssetType> GetCategories(BodyType bodyType)
{ "beardColor", AssetType.BeardColor },
{ "bottom", AssetType.Bottom },
{ "top", AssetType.Top },
{ "footwear", AssetType.Footwear }
{ "footwear", AssetType.Footwear },
{ "costume", AssetType.Costume }
};
}
}
Loading

0 comments on commit a5c1320

Please sign in to comment.