Skip to content

Commit

Permalink
chore: fix hair selection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jan 10, 2025
1 parent 231b447 commit 95b58b6
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ReadyPlayerMe.AvatarCreator;
using ReadyPlayerMe.Core;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Serialization;
using TaskExtensions = ReadyPlayerMe.AvatarCreator.TaskExtensions;

namespace ReadyPlayerMe.Samples.AvatarCreatorElements
Expand Down Expand Up @@ -39,7 +35,7 @@ public async Task SelectAsset(IAssetData assetData)
{
OnAvatarLoading?.Invoke();
GameObject newAvatar;
if(assetData.AssetType == AssetType.Headwear && ActiveAvatarProperties.Assets.ContainsKey(AssetType.HairStyle))
if (assetData.AssetType == AssetType.Headwear && ActiveAvatarProperties.Assets.ContainsKey(AssetType.HairStyle))
{
var assets = new Dictionary<AssetType, object>();
assets.Add(AssetType.HairStyle, ActiveAvatarProperties.Assets[AssetType.HairStyle]);
Expand All @@ -50,6 +46,7 @@ public async Task SelectAsset(IAssetData assetData)
{
newAvatar = await avatarManager.UpdateAsset(assetData.AssetType, assetData.Id);
}
ActiveAvatarProperties.Assets[assetData.AssetType] = assetData.Id;
SetupLoadedAvatar(newAvatar, ActiveAvatarProperties);
}

Expand Down

0 comments on commit 95b58b6

Please sign in to comment.