fix(unity): resolve all 32 C# compilation errors
- CardModel: add missing `id` field - CardModel: `imageUrl` → `imageUri` (match JSON property name) - DeckModel: `commanderName` → `commander` (match JSON property name) - PreconDeck: `imageUrl` → `imageUri` - Add missing `PreconListWrapper` model class - Add `using UnityEngine.Networking` to CollectionController, DeckGeneratorController, PreconController - Remove double StartCoroutine() wrapping on ApiClient calls (GetRaw/PatchRaw/Delete/PostRaw already return Coroutine) Affected: CollectionController, DeckBuilderController, DeckGeneratorController, ScannerController, CoachController
This commit is contained in:
1 parent
2d8a55fdc6
commit
a501a9755d
9 files changed
+47
-30
No files matched your search
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
using TMPro;
|
||||
@@ -184,9 +185,9 @@ namespace CommanderAILab.UI
|
||||
_sortField = SortFieldFromDropdown(sortDropdown.value);
|
||||
|
||||
string path = BuildQueryPath(page);
|
||||
StartCoroutine(ApiClient.Instance.GetRaw(path,
|
||||
ApiClient.Instance.GetRaw(path,
|
||||
json => OnPageLoaded(json, page),
|
||||
errMsg => OnLoadError(errMsg)));
|
||||
errMsg => OnLoadError(errMsg));
|
||||
}
|
||||
|
||||
private string BuildQueryPath(int page)
|
||||
@@ -257,9 +258,9 @@ namespace CommanderAILab.UI
|
||||
|
||||
// Async image load
|
||||
var img = tile.GetComponentInChildren<Image>();
|
||||
if (img != null && !string.IsNullOrEmpty(card.imageUrl))
|
||||
if (img != null && !string.IsNullOrEmpty(card.imageUri))
|
||||
{
|
||||
ImageCache.Instance.GetSprite(card.imageUrl, sprite =>
|
||||
ImageCache.Instance.GetSprite(card.imageUri, sprite =>
|
||||
{
|
||||
if (img != null) img.sprite = sprite;
|
||||
});
|
||||
@@ -297,9 +298,9 @@ namespace CommanderAILab.UI
|
||||
detailQuantity.text = $"Owned: {card.ownedQty}";
|
||||
|
||||
// Load card art on front face
|
||||
if (!string.IsNullOrEmpty(card.imageUrl))
|
||||
if (!string.IsNullOrEmpty(card.imageUri))
|
||||
{
|
||||
ImageCache.Instance.GetSprite(card.imageUrl, sprite =>
|
||||
ImageCache.Instance.GetSprite(card.imageUri, sprite =>
|
||||
{
|
||||
if (detailCardFront != null) detailCardFront.sprite = sprite;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user