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:
KoalaTrapLord committed 2026-03-19 05:13:00 +00:00
1 parent 2d8a55fdc6
commit a501a9755d
9 files changed
+47 -30

No files matched your search

@@ -292,8 +292,8 @@ namespace CommanderAILab.UI
resultSet.text = card.set;
resultOracleText.text = card.oracleText;
resultConfidence.text = $"Confidence: {confidence:P0}";
if (!string.IsNullOrEmpty(card.imageUrl))
ImageCache.Instance.GetSprite(card.imageUrl, s => { if (resultCardImage != null) resultCardImage.sprite = s; });
if (!string.IsNullOrEmpty(card.imageUri))
ImageCache.Instance.GetSprite(card.imageUri, s => { if (resultCardImage != null) resultCardImage.sprite = s; });
AddToHistory(card);
}
@@ -320,9 +320,9 @@ namespace CommanderAILab.UI
{
if (_scannedCard == null) return;
var body = JsonConvert.SerializeObject(new { card_id = _scannedCard.id, qty = 1 });
StartCoroutine(ApiClient.Instance.PostRaw("/api/collection/add", body,
ApiClient.Instance.PostRaw("/api/collection/add", body,
_ => cameraStatusText.text = $"Added {_scannedCard.name} to collection",
err => ShowError($"Add to collection failed:\n{err}")));
err => ShowError($"Add to collection failed:\n{err}"));
}
private void OnAddToDeck()