Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
103 lines
2.9 KiB
C#
103 lines
2.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Cute;
|
|
using UnityEngine;
|
|
|
|
namespace Wizard;
|
|
|
|
public class DeckViewHelper : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private GameObject _cardDetailPrefab;
|
|
|
|
[SerializeField]
|
|
private GameObject _deckViewPrefab;
|
|
|
|
private List<string> _loadCardAssetList;
|
|
|
|
private UICardList _uiCardList;
|
|
|
|
private int _detailLayer;
|
|
|
|
private CardDetailUI _cardDetail;
|
|
|
|
private bool _isEnableShareButton = true;
|
|
|
|
public UICardList UICardList => _uiCardList;
|
|
|
|
public void Initialize(string detailLayerName = "Detail")
|
|
{
|
|
_detailLayer = LayerMask.NameToLayer(detailLayerName);
|
|
_cardDetail = UnityEngine.Object.Instantiate(_cardDetailPrefab).GetComponent<CardDetailUI>();
|
|
_cardDetail.transform.parent = base.transform;
|
|
_cardDetail.transform.localPosition = Vector3.zero;
|
|
_cardDetail.transform.localScale = Vector3.one;
|
|
_cardDetail.Initialize(_detailLayer, CardMaster.CardMasterId.Default);
|
|
SetEnableFlavorVoiceEvolution(enable: false);
|
|
_cardDetail.gameObject.SetActive(value: false);
|
|
_uiCardList = UnityEngine.Object.Instantiate(_deckViewPrefab).GetComponent<UICardList>();
|
|
_uiCardList.Init(base.gameObject, _cardDetail, null, CloseDeckView, detailLayerName, in_DetailCameraUse: true, null, 40);
|
|
_uiCardList.SetActive(in_Active: false);
|
|
}
|
|
|
|
public void SetDetailCameraEnable(bool enable)
|
|
{
|
|
_uiCardList.SetCameraEnable(enable);
|
|
}
|
|
|
|
public void SetEnableDeckShareButton(bool enable)
|
|
{
|
|
_uiCardList.SetShareButtonUse(enable);
|
|
_isEnableShareButton = enable;
|
|
}
|
|
|
|
public void SetEnableFlavorVoiceEvolution(bool enable)
|
|
{
|
|
_cardDetail.IsShowFlavorTextButton = enable;
|
|
_cardDetail.IsShowVoiceButton = enable;
|
|
_cardDetail.IsShowEvolutionButton = enable;
|
|
}
|
|
|
|
public void ShowDeckView(DeckData deck)
|
|
{
|
|
UIManager.GetInstance().createInSceneCenterLoading();
|
|
StartCoroutine(LoadDeckCard(deck, delegate
|
|
{
|
|
UIManager.GetInstance().closeInSceneCenterLoading();
|
|
_uiCardList.SetDeck(deck, null);
|
|
_uiCardList.SetShareButtonUse(_isEnableShareButton);
|
|
_uiCardList.SetQRSmallTexture();
|
|
StartCoroutine(WaitSingleFrame(delegate
|
|
{
|
|
_uiCardList.SetActive(in_Active: true);
|
|
}));
|
|
}));
|
|
}
|
|
|
|
private IEnumerator WaitSingleFrame(Action onFinish)
|
|
{
|
|
yield return null;
|
|
onFinish.Call();
|
|
}
|
|
|
|
private IEnumerator LoadDeckCard(DeckData deck, Action onFinish)
|
|
{
|
|
IList<int> cardIdList = deck.GetCardIdList();
|
|
_uiCardList.RemoveData();
|
|
_loadCardAssetList = _uiCardList.GetLoadFileList(cardIdList as List<int>);
|
|
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadCardAssetList, null));
|
|
onFinish();
|
|
}
|
|
|
|
private void CloseDeckView()
|
|
{
|
|
if (_loadCardAssetList != null)
|
|
{
|
|
Toolbox.ResourcesManager.RemoveAssetGroup(_loadCardAssetList);
|
|
_loadCardAssetList = null;
|
|
}
|
|
_uiCardList.SetActive(in_Active: false);
|
|
}
|
|
}
|