| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.Runtime.CompilerServices; |
| | 4 | | using UnityEngine; |
| | 5 | | using UnityEngine.UI; |
| | 6 | |
|
| | 7 | | [assembly: InternalsVisibleTo("AvatarEditorHUDTests")] |
| | 8 | |
|
| | 9 | | public class AvatarEditorHUDView : MonoBehaviour |
| | 10 | | { |
| 1 | 11 | | private static readonly int RANDOMIZE_ANIMATOR_LOADING_BOOL = Animator.StringToHash("Loading"); |
| | 12 | | private const string VIEW_PATH = "AvatarEditorHUD"; |
| | 13 | | private const string VIEW_OBJECT_NAME = "_AvatarEditorHUD"; |
| | 14 | |
|
| 0 | 15 | | public bool isOpen { get; private set; } |
| | 16 | |
|
| | 17 | | internal bool arePanelsInitialized = false; |
| | 18 | |
|
| | 19 | | [Serializable] |
| | 20 | | public class AvatarEditorNavigationInfo |
| | 21 | | { |
| | 22 | | public Toggle toggle; |
| | 23 | | public Canvas canvas; |
| | 24 | | public bool enabledByDefault; |
| | 25 | | public CharacterPreviewController.CameraFocus focus = CharacterPreviewController.CameraFocus.DefaultEditing; |
| | 26 | |
|
| | 27 | | //To remove when we refactor this to avoid ToggleGroup issues when quitting application |
| 1800 | 28 | | public void Initialize() { Application.quitting += () => toggle.onValueChanged.RemoveAllListeners(); } |
| | 29 | | } |
| | 30 | |
|
| | 31 | | [Serializable] |
| | 32 | | public class AvatarEditorWearableFilter |
| | 33 | | { |
| | 34 | | public string categoryFilter; |
| | 35 | | public ItemSelector selector; |
| | 36 | | } |
| | 37 | |
|
| | 38 | | [SerializeField] |
| | 39 | | internal Canvas avatarEditorCanvas; |
| | 40 | |
|
| | 41 | | [SerializeField] |
| | 42 | | internal CanvasGroup avatarEditorCanvasGroup; |
| | 43 | |
|
| | 44 | | [SerializeField] |
| | 45 | | internal AvatarEditorNavigationInfo[] navigationInfos; |
| | 46 | |
|
| | 47 | | [SerializeField] |
| | 48 | | internal AvatarEditorWearableFilter[] wearableGridPairs; |
| | 49 | |
|
| | 50 | | [SerializeField] |
| | 51 | | internal AvatarEditorNavigationInfo collectiblesNavigationInfo; |
| | 52 | |
|
| | 53 | | [SerializeField] |
| | 54 | | internal ItemSelector collectiblesItemSelector; |
| | 55 | |
|
| | 56 | | [SerializeField] |
| | 57 | | internal ColorSelector skinColorSelector; |
| | 58 | |
|
| | 59 | | [SerializeField] |
| | 60 | | internal ColorSelector eyeColorSelector; |
| | 61 | |
|
| | 62 | | [SerializeField] |
| | 63 | | internal ColorSelector hairColorSelector; |
| | 64 | |
|
| | 65 | | [SerializeField] |
| | 66 | | internal GameObject characterPreviewPrefab; |
| | 67 | |
|
| | 68 | | [SerializeField] |
| | 69 | | internal PreviewCameraRotation characterPreviewRotation; |
| | 70 | |
|
| | 71 | | [SerializeField] |
| | 72 | | internal Button randomizeButton; |
| | 73 | |
|
| | 74 | | [SerializeField] |
| | 75 | | internal Animator randomizeAnimator; |
| | 76 | |
|
| | 77 | | [SerializeField] |
| | 78 | | internal Button doneButton; |
| | 79 | |
|
| | 80 | | [SerializeField] internal Button[] goToMarketplaceButtons; |
| | 81 | |
|
| | 82 | | [SerializeField] internal GameObject loadingSpinnerGameObject; |
| | 83 | |
|
| | 84 | | [Header("Collectibles")] |
| | 85 | | [SerializeField] |
| | 86 | | internal GameObject web3Container; |
| | 87 | |
|
| | 88 | | [SerializeField] |
| | 89 | | internal GameObject noWeb3Container; |
| | 90 | |
|
| | 91 | | [Header("Skins")] |
| | 92 | |
|
| | 93 | | [SerializeField] internal GameObject skinsFeatureContainer; |
| | 94 | |
|
| | 95 | | [SerializeField] internal GameObject skinsWeb3Container; |
| | 96 | |
|
| | 97 | | [SerializeField] internal GameObject skinsMissingWeb3Container; |
| | 98 | |
|
| | 99 | | [SerializeField] internal GameObject skinsConnectWalletButtonContainer; |
| | 100 | |
|
| | 101 | | [SerializeField] private GameObject skinsPopulatedListContainer; |
| | 102 | | [SerializeField] private GameObject skinsEmptyListContainer; |
| | 103 | |
|
| | 104 | | internal static CharacterPreviewController characterPreviewController; |
| | 105 | | private AvatarEditorHUDController controller; |
| 47 | 106 | | internal readonly Dictionary<string, ItemSelector> selectorsByCategory = new Dictionary<string, ItemSelector>(); |
| 47 | 107 | | private readonly HashSet<WearableItem> wearablesWithLoadingSpinner = new HashSet<WearableItem>(); |
| | 108 | |
|
| | 109 | | public event Action<AvatarModel> OnAvatarAppear; |
| | 110 | | public event Action<bool> OnSetVisibility; |
| | 111 | | public event Action OnRandomize; |
| | 112 | |
|
| | 113 | | private void Awake() |
| | 114 | | { |
| 46 | 115 | | loadingSpinnerGameObject.SetActive(false); |
| 46 | 116 | | doneButton.interactable = false; //the default state of the button should be disable until a profile has been lo |
| 46 | 117 | | if (characterPreviewController == null) |
| | 118 | | { |
| 46 | 119 | | characterPreviewController = Instantiate(characterPreviewPrefab).GetComponent<CharacterPreviewController>(); |
| 46 | 120 | | characterPreviewController.name = "_CharacterPreviewController"; |
| | 121 | | } |
| | 122 | |
|
| 46 | 123 | | isOpen = false; |
| 46 | 124 | | arePanelsInitialized = false; |
| 46 | 125 | | } |
| | 126 | |
|
| | 127 | | private void Initialize(AvatarEditorHUDController controller) |
| | 128 | | { |
| 46 | 129 | | this.controller = controller; |
| 46 | 130 | | gameObject.name = VIEW_OBJECT_NAME; |
| | 131 | |
|
| 46 | 132 | | randomizeButton.onClick.AddListener(OnRandomizeButton); |
| 46 | 133 | | doneButton.onClick.AddListener(OnDoneButton); |
| 46 | 134 | | InitializeWearableChangeEvents(); |
| | 135 | |
|
| 552 | 136 | | foreach (var button in goToMarketplaceButtons) |
| 230 | 137 | | button.onClick.RemoveAllListeners(); |
| 552 | 138 | | foreach (var button in goToMarketplaceButtons) |
| 230 | 139 | | button.onClick.AddListener(controller.GoToMarketplaceOrConnectWallet); |
| | 140 | |
|
| 46 | 141 | | characterPreviewController.camera.enabled = false; |
| 46 | 142 | | } |
| | 143 | |
|
| | 144 | | public void SetIsWeb3(bool isWeb3User) |
| | 145 | | { |
| 99 | 146 | | web3Container.SetActive(isWeb3User); |
| 99 | 147 | | noWeb3Container.SetActive(!isWeb3User); |
| 99 | 148 | | skinsWeb3Container.SetActive(isWeb3User); |
| 99 | 149 | | skinsMissingWeb3Container.SetActive(!isWeb3User); |
| 99 | 150 | | } |
| | 151 | |
|
| | 152 | | internal void InitializeNavigationEvents(bool isGuest) |
| | 153 | | { |
| 99 | 154 | | if (arePanelsInitialized) |
| 54 | 155 | | return; |
| | 156 | |
|
| 1800 | 157 | | for (int i = 0; i < navigationInfos.Length; i++) |
| | 158 | | { |
| 855 | 159 | | InitializeNavigationInfo(navigationInfos[i]); |
| | 160 | | } |
| 45 | 161 | | InitializeNavigationInfo(collectiblesNavigationInfo, !isGuest); |
| | 162 | |
|
| 45 | 163 | | characterPreviewRotation.OnHorizontalRotation += characterPreviewController.Rotate; |
| 45 | 164 | | arePanelsInitialized = true; |
| 45 | 165 | | } |
| | 166 | |
|
| | 167 | | private void InitializeNavigationInfo(AvatarEditorNavigationInfo current, bool isActive) |
| | 168 | | { |
| 900 | 169 | | current.Initialize(); |
| | 170 | |
|
| 900 | 171 | | current.toggle.isOn = isActive ? current.enabledByDefault : false; |
| 900 | 172 | | current.canvas.gameObject.SetActive(isActive ? current.enabledByDefault : false); |
| | 173 | |
|
| 900 | 174 | | current.toggle.onValueChanged.AddListener((on) => |
| | 175 | | { |
| 45 | 176 | | current.canvas.gameObject.SetActive(@on); |
| 45 | 177 | | characterPreviewController.SetFocus(current.focus); |
| 45 | 178 | | }); |
| 900 | 179 | | } |
| | 180 | |
|
| | 181 | | private void InitializeNavigationInfo(AvatarEditorNavigationInfo current) |
| | 182 | | { |
| 855 | 183 | | InitializeNavigationInfo(current, true); |
| 855 | 184 | | } |
| | 185 | |
|
| | 186 | | private void InitializeWearableChangeEvents() |
| | 187 | | { |
| 46 | 188 | | int nPairs = wearableGridPairs.Length; |
| 1656 | 189 | | for (int i = 0; i < nPairs; i++) |
| | 190 | | { |
| 782 | 191 | | wearableGridPairs[i].selector.OnItemClicked += controller.WearableClicked; |
| 782 | 192 | | wearableGridPairs[i].selector.OnSellClicked += controller.SellCollectible; |
| 782 | 193 | | selectorsByCategory.Add(wearableGridPairs[i].categoryFilter, wearableGridPairs[i].selector); |
| | 194 | | } |
| | 195 | |
|
| 46 | 196 | | collectiblesItemSelector.OnItemClicked += controller.WearableClicked; |
| 46 | 197 | | collectiblesItemSelector.OnSellClicked += controller.SellCollectible; |
| 46 | 198 | | collectiblesItemSelector.OnRetryClicked += controller.RetryLoadOwnedWearables; |
| | 199 | |
|
| 46 | 200 | | skinColorSelector.OnColorChanged += controller.SkinColorClicked; |
| 46 | 201 | | eyeColorSelector.OnColorChanged += controller.EyesColorClicked; |
| 46 | 202 | | hairColorSelector.OnColorChanged += controller.HairColorClicked; |
| 46 | 203 | | } |
| | 204 | |
|
| | 205 | | internal static AvatarEditorHUDView Create(AvatarEditorHUDController controller) |
| | 206 | | { |
| 46 | 207 | | var view = Instantiate(Resources.Load<GameObject>(VIEW_PATH)).GetComponent<AvatarEditorHUDView>(); |
| 46 | 208 | | view.Initialize(controller); |
| 46 | 209 | | return view; |
| | 210 | | } |
| | 211 | |
|
| | 212 | | public void UpdateSelectedBody(WearableItem bodyShape) |
| | 213 | | { |
| 1800 | 214 | | for (int i = 0; i < wearableGridPairs.Length; i++) |
| | 215 | | { |
| 850 | 216 | | if (wearableGridPairs[i].categoryFilter == WearableLiterals.Categories.BODY_SHAPE) |
| | 217 | | { |
| 50 | 218 | | wearableGridPairs[i].selector.UnselectAll(); |
| 50 | 219 | | wearableGridPairs[i].selector.Select(bodyShape.id); |
| 50 | 220 | | } |
| | 221 | | else |
| | 222 | | { |
| 800 | 223 | | wearableGridPairs[i].selector.SetBodyShape(bodyShape.id); |
| | 224 | | } |
| | 225 | | } |
| | 226 | |
|
| 50 | 227 | | collectiblesItemSelector.SetBodyShape(bodyShape.id); |
| 50 | 228 | | } |
| | 229 | |
|
| | 230 | | public void EquipWearable(WearableItem wearable) |
| | 231 | | { |
| 978 | 232 | | selectorsByCategory[wearable.data.category].Select(wearable.id); |
| 978 | 233 | | SetWearableLoadingSpinner(wearable, true); |
| 978 | 234 | | collectiblesItemSelector.Select(wearable.id); |
| 978 | 235 | | } |
| | 236 | |
|
| | 237 | | public void UnequipWearable(WearableItem wearable) |
| | 238 | | { |
| 443 | 239 | | selectorsByCategory[wearable.data.category].Unselect(wearable.id); |
| 443 | 240 | | SetWearableLoadingSpinner(wearable, false); |
| 443 | 241 | | collectiblesItemSelector.Unselect(wearable.id); |
| 443 | 242 | | } |
| | 243 | |
|
| | 244 | | internal void SetWearableLoadingSpinner(WearableItem wearable, bool isActive) |
| | 245 | | { |
| 1421 | 246 | | selectorsByCategory[wearable.data.category].SetWearableLoadingSpinner(wearable.id, isActive); |
| 1421 | 247 | | collectiblesItemSelector.SetWearableLoadingSpinner(wearable.id, isActive); |
| 1421 | 248 | | if (isActive) |
| 978 | 249 | | wearablesWithLoadingSpinner.Add(wearable); |
| | 250 | | else |
| 443 | 251 | | wearablesWithLoadingSpinner.Remove(wearable); |
| 443 | 252 | | } |
| | 253 | |
|
| | 254 | | internal void ClearWearablesLoadingSpinner() |
| | 255 | | { |
| 1126 | 256 | | foreach (WearableItem wearable in wearablesWithLoadingSpinner) |
| | 257 | | { |
| 442 | 258 | | selectorsByCategory[wearable.data.category].SetWearableLoadingSpinner(wearable.id, false); |
| 442 | 259 | | collectiblesItemSelector.SetWearableLoadingSpinner(wearable.id, false); |
| | 260 | | } |
| | 261 | |
|
| 121 | 262 | | wearablesWithLoadingSpinner.Clear(); |
| 121 | 263 | | } |
| | 264 | |
|
| 208 | 265 | | public void SelectHairColor(Color hairColor) { hairColorSelector.Select(hairColor); } |
| | 266 | |
|
| 206 | 267 | | public void SelectSkinColor(Color skinColor) { skinColorSelector.Select(skinColor); } |
| | 268 | |
|
| 208 | 269 | | public void SelectEyeColor(Color eyesColor) { eyeColorSelector.Select(eyesColor); } |
| | 270 | |
|
| | 271 | | public void SetColors(List<Color> skinColors, List<Color> hairColors, List<Color> eyeColors) |
| | 272 | | { |
| 46 | 273 | | skinColorSelector.Populate(skinColors); |
| 46 | 274 | | eyeColorSelector.Populate(eyeColors); |
| 46 | 275 | | hairColorSelector.Populate(hairColors); |
| 46 | 276 | | } |
| | 277 | |
|
| | 278 | | public void UnselectAllWearables() |
| | 279 | | { |
| 3600 | 280 | | for (int i = 0; i < wearableGridPairs.Length; i++) |
| | 281 | | { |
| 1700 | 282 | | if (wearableGridPairs[i].categoryFilter != WearableLiterals.Categories.BODY_SHAPE) |
| | 283 | | { |
| 1600 | 284 | | wearableGridPairs[i].selector.UnselectAll(); |
| | 285 | | } |
| | 286 | | } |
| | 287 | |
|
| 100 | 288 | | collectiblesItemSelector.UnselectAll(); |
| 100 | 289 | | } |
| | 290 | |
|
| | 291 | | public void UpdateAvatarPreview(AvatarModel avatarModel) |
| | 292 | | { |
| 121 | 293 | | if (avatarModel?.wearables == null) |
| 0 | 294 | | return; |
| | 295 | |
|
| 121 | 296 | | doneButton.interactable = false; |
| 121 | 297 | | loadingSpinnerGameObject.SetActive(true); |
| 121 | 298 | | characterPreviewController.UpdateModel(avatarModel, |
| | 299 | | () => |
| | 300 | | { |
| 121 | 301 | | if (doneButton != null) |
| 101 | 302 | | doneButton.interactable = true; |
| | 303 | |
|
| 121 | 304 | | loadingSpinnerGameObject?.SetActive(false); |
| 121 | 305 | | OnAvatarAppear?.Invoke(avatarModel); |
| 121 | 306 | | ClearWearablesLoadingSpinner(); |
| 121 | 307 | | randomizeAnimator?.SetBool(RANDOMIZE_ANIMATOR_LOADING_BOOL, false); |
| 101 | 308 | | }); |
| 121 | 309 | | } |
| | 310 | |
|
| | 311 | | public void AddWearable(WearableItem wearableItem, int amount, |
| | 312 | | Func<WearableItem, bool> hideOtherWearablesToastStrategy, |
| | 313 | | Func<WearableItem, bool> replaceOtherWearablesToastStrategy) |
| | 314 | | { |
| 4050 | 315 | | if (wearableItem == null) |
| 0 | 316 | | return; |
| | 317 | |
|
| 4050 | 318 | | if (!selectorsByCategory.ContainsKey(wearableItem.data.category)) |
| | 319 | | { |
| 0 | 320 | | Debug.LogError($"Category couldn't find selector for category: {wearableItem.data.category} "); |
| 0 | 321 | | return; |
| | 322 | | } |
| | 323 | |
|
| 4050 | 324 | | selectorsByCategory[wearableItem.data.category].AddItemToggle(wearableItem, amount, |
| | 325 | | hideOtherWearablesToastStrategy, replaceOtherWearablesToastStrategy); |
| 4050 | 326 | | if (wearableItem.IsCollectible()) |
| | 327 | | { |
| 18 | 328 | | collectiblesItemSelector.AddItemToggle(wearableItem, amount, |
| | 329 | | hideOtherWearablesToastStrategy, replaceOtherWearablesToastStrategy); |
| | 330 | | } |
| 4050 | 331 | | } |
| | 332 | |
|
| | 333 | | public void RemoveWearable(WearableItem wearableItem) |
| | 334 | | { |
| 0 | 335 | | if (wearableItem == null) |
| 0 | 336 | | return; |
| | 337 | |
|
| 0 | 338 | | if (!selectorsByCategory.ContainsKey(wearableItem.data.category)) |
| | 339 | | { |
| 0 | 340 | | Debug.LogError($"Category couldn't find selector for category: {wearableItem.data.category} "); |
| 0 | 341 | | return; |
| | 342 | | } |
| | 343 | |
|
| 0 | 344 | | selectorsByCategory[wearableItem.data.category].RemoveItemToggle(wearableItem.id); |
| 0 | 345 | | if (wearableItem.IsCollectible()) |
| 0 | 346 | | collectiblesItemSelector.RemoveItemToggle(wearableItem.id); |
| 0 | 347 | | } |
| | 348 | |
|
| | 349 | | public void RemoveAllWearables() |
| | 350 | | { |
| 145 | 351 | | using (var enumerator = selectorsByCategory.GetEnumerator()) |
| | 352 | | { |
| 2610 | 353 | | while (enumerator.MoveNext()) |
| | 354 | | { |
| 2465 | 355 | | enumerator.Current.Value.RemoveAllItemToggle(); |
| | 356 | | } |
| 145 | 357 | | } |
| | 358 | |
|
| 145 | 359 | | collectiblesItemSelector.RemoveAllItemToggle(); |
| 145 | 360 | | } |
| | 361 | |
|
| | 362 | | private void OnRandomizeButton() |
| | 363 | | { |
| 0 | 364 | | OnRandomize?.Invoke(); |
| 0 | 365 | | controller.RandomizeWearables(); |
| 0 | 366 | | randomizeAnimator?.SetBool(RANDOMIZE_ANIMATOR_LOADING_BOOL, true); |
| 0 | 367 | | } |
| | 368 | |
|
| | 369 | | private void OnDoneButton() |
| | 370 | | { |
| 0 | 371 | | doneButton.interactable = false; |
| 0 | 372 | | characterPreviewController.TakeSnapshots(OnSnapshotsReady, OnSnapshotsFailed); |
| 0 | 373 | | } |
| | 374 | |
|
| | 375 | | private void OnSnapshotsReady(Texture2D face256, Texture2D body) |
| | 376 | | { |
| 0 | 377 | | doneButton.interactable = true; |
| 0 | 378 | | controller.SaveAvatar(face256, body); |
| 0 | 379 | | } |
| | 380 | |
|
| 0 | 381 | | private void OnSnapshotsFailed() { doneButton.interactable = true; } |
| | 382 | |
|
| | 383 | | public void SetVisibility(bool visible) |
| | 384 | | { |
| 88 | 385 | | characterPreviewController.camera.enabled = visible; |
| 88 | 386 | | avatarEditorCanvas.enabled = visible; |
| 88 | 387 | | avatarEditorCanvasGroup.blocksRaycasts = visible; |
| | 388 | |
|
| 88 | 389 | | if (visible && !isOpen) |
| 41 | 390 | | OnSetVisibility?.Invoke(visible); |
| 47 | 391 | | else if (!visible && isOpen) |
| 1 | 392 | | OnSetVisibility?.Invoke(visible); |
| | 393 | |
|
| 88 | 394 | | isOpen = visible; |
| 88 | 395 | | } |
| | 396 | |
|
| | 397 | | public void CleanUp() |
| | 398 | | { |
| 46 | 399 | | loadingSpinnerGameObject = null; |
| 46 | 400 | | randomizeAnimator = null; |
| 46 | 401 | | if (wearableGridPairs != null) |
| | 402 | | { |
| 46 | 403 | | int nPairs = wearableGridPairs.Length; |
| 1656 | 404 | | for (int i = 0; i < nPairs; i++) |
| | 405 | | { |
| 782 | 406 | | var itemSelector = wearableGridPairs[i].selector; |
| 782 | 407 | | if (itemSelector != null) |
| | 408 | | { |
| 782 | 409 | | itemSelector.OnItemClicked -= controller.WearableClicked; |
| 782 | 410 | | itemSelector.OnSellClicked -= controller.SellCollectible; |
| | 411 | | } |
| | 412 | | } |
| | 413 | | } |
| | 414 | |
|
| 46 | 415 | | if (collectiblesItemSelector != null) |
| | 416 | | { |
| 46 | 417 | | collectiblesItemSelector.OnItemClicked -= controller.WearableClicked; |
| 46 | 418 | | collectiblesItemSelector.OnSellClicked -= controller.SellCollectible; |
| 46 | 419 | | collectiblesItemSelector.OnRetryClicked -= controller.RetryLoadOwnedWearables; |
| | 420 | | } |
| | 421 | |
|
| 46 | 422 | | if (skinColorSelector != null) |
| 46 | 423 | | skinColorSelector.OnColorChanged -= controller.SkinColorClicked; |
| 46 | 424 | | if (eyeColorSelector != null) |
| 46 | 425 | | eyeColorSelector.OnColorChanged -= controller.EyesColorClicked; |
| 46 | 426 | | if (hairColorSelector != null) |
| 46 | 427 | | hairColorSelector.OnColorChanged -= controller.HairColorClicked; |
| | 428 | |
|
| 46 | 429 | | if (this != null) |
| 46 | 430 | | Destroy(gameObject); |
| | 431 | |
|
| 46 | 432 | | if (characterPreviewController != null) |
| | 433 | | { |
| 46 | 434 | | Destroy(characterPreviewController.gameObject); |
| 46 | 435 | | characterPreviewController = null; |
| | 436 | | } |
| 46 | 437 | | } |
| | 438 | |
|
| 2 | 439 | | public void ShowCollectiblesLoadingSpinner(bool isActive) { collectiblesItemSelector.ShowLoading(isActive); } |
| | 440 | |
|
| 2 | 441 | | public void ShowCollectiblesLoadingRetry(bool isActive) { collectiblesItemSelector.ShowRetryLoading(isActive); } |
| | 442 | |
|
| | 443 | | public void SetAsFullScreenMenuMode(Transform parentTransform) |
| | 444 | | { |
| 46 | 445 | | if (parentTransform == null) |
| 46 | 446 | | return; |
| | 447 | |
|
| 0 | 448 | | transform.SetParent(parentTransform); |
| 0 | 449 | | transform.localScale = Vector3.one; |
| | 450 | |
|
| 0 | 451 | | RectTransform rectTransform = transform as RectTransform; |
| 0 | 452 | | rectTransform.anchorMin = Vector2.zero; |
| 0 | 453 | | rectTransform.anchorMax = Vector2.one; |
| 0 | 454 | | rectTransform.pivot = new Vector2(0.5f, 0.5f); |
| 0 | 455 | | rectTransform.localPosition = Vector2.zero; |
| 0 | 456 | | rectTransform.offsetMax = new Vector2(0f, 50f); |
| 0 | 457 | | rectTransform.offsetMin = Vector2.zero; |
| 0 | 458 | | } |
| | 459 | |
|
| | 460 | | public void ShowSkinPopulatedList(bool show) |
| | 461 | | { |
| 0 | 462 | | skinsPopulatedListContainer.SetActive(show); |
| 0 | 463 | | skinsEmptyListContainer.SetActive(!show); |
| 0 | 464 | | skinsConnectWalletButtonContainer.SetActive(show); |
| 0 | 465 | | } |
| | 466 | | } |