File tree 2 files changed +22
-5
lines changed
Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens
2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,6 @@ Steps for trying out avatar creator sample can be found [here.](Documentation~/A
34
34
A guide for customizing avatar creator can be found [ here.] ( Documentation~/CustomizationGuide.md )
35
35
36
36
### Note
37
- - [ * ] Camera support is only provided for Windows and WebGL, using Unity’s webcam native API.
37
+ - Camera support is only provided for Windows and WebGL, using Unity’s webcam native API.
38
38
- Unity does not have a native file picker, so we have discontinued support for this feature.
39
39
- To add support for file picker (for selfies) you have to implement it yourself
Original file line number Diff line number Diff line change @@ -201,15 +201,32 @@ private async Task LoadAvatarColors()
201
201
{
202
202
var startTime = Time . time ;
203
203
var colors = await avatarManager . LoadAvatarColors ( ) ;
204
-
205
- var colorAssetTypes = AssetFilterHelper . GetAssetTypesByFilter ( AssetFilter . Color ) . ToHashSet ( ) ;
206
- var equippedColors = AvatarCreatorData . AvatarProperties . Assets . Where ( kvp => colorAssetTypes . Contains ( kvp . Key ) )
207
- . ToDictionary ( kvp => kvp . Key , kvp => Convert . ToInt32 ( kvp . Value ) ) ;
204
+ var equippedColors = GetEquippedColors ( ) ;
208
205
209
206
assetButtonCreator . CreateColorUI ( colors , UpdateAvatar , equippedColors ) ;
210
207
SDKLogger . Log ( TAG , $ "All colors loaded in { Time . time - startTime : F2} s") ;
211
208
}
212
209
210
+ private Dictionary < AssetType , int > GetEquippedColors ( )
211
+ {
212
+ var colorAssetTypes = AssetFilterHelper . GetAssetTypesByFilter ( AssetFilter . Color ) . ToHashSet ( ) ;
213
+ return AvatarCreatorData . AvatarProperties . Assets
214
+ . Where ( kvp => colorAssetTypes . Contains ( kvp . Key ) )
215
+ . ToDictionary (
216
+ kvp => kvp . Key ,
217
+ kvp =>
218
+ {
219
+ try
220
+ {
221
+ return Convert . ToInt32 ( kvp . Value ) ;
222
+ }
223
+ catch
224
+ {
225
+ return 0 ;
226
+ }
227
+ } ) ;
228
+ }
229
+
213
230
private void CreateUI ( )
214
231
{
215
232
categoryUICreator . Setup ( ) ;
You can’t perform that action at this time.
0 commit comments