| | 1 | | using System.Collections.Generic; |
| | 2 | | using DCL.Helpers; |
| | 3 | | using System.Linq; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | public static class AvatarAssetsTestHelpers |
| | 7 | | { |
| | 8 | | public static BaseDictionary<string, WearableItem> CreateTestCatalogLocal() |
| | 9 | | { |
| 53 | 10 | | List<WearableItemDummy> wearables = Object.Instantiate(Resources.Load<WearableItemDummyListVariable>("TestCatalo |
| 3180 | 11 | | foreach (var wearableItem in wearables) |
| | 12 | | { |
| 1537 | 13 | | wearableItem.baseUrl = TestAssetsUtils.GetPath() + "/Avatar/Assets/"; |
| | 14 | |
|
| 6572 | 15 | | foreach (var rep in wearableItem.data.representations) |
| | 16 | | { |
| 1749 | 17 | | rep.contents = rep.contents.Select((x) => |
| | 18 | | { |
| 3869 | 19 | | x.hash = x.key; |
| 3869 | 20 | | return x; |
| | 21 | | }) |
| | 22 | | .ToArray(); |
| | 23 | | } |
| | 24 | |
|
| 1537 | 25 | | wearableItem.thumbnail = ""; |
| | 26 | | } |
| | 27 | |
|
| 53 | 28 | | CatalogController.wearableCatalog.Clear(); |
| 1590 | 29 | | var dummyWereables = wearables.Select(x => new KeyValuePair<string, WearableItem>(x.id, x)).ToArray(); |
| 3180 | 30 | | foreach (var item in dummyWereables) |
| | 31 | | { |
| 1537 | 32 | | CatalogController.wearableCatalog.Add(item.Key, item.Value); |
| | 33 | | } |
| | 34 | |
|
| 53 | 35 | | return CatalogController.wearableCatalog; |
| | 36 | | } |
| | 37 | | } |