Commit 713cb946 authored by SherryChaos's avatar SherryChaos

fix loading bug

parent 32516fb5
This diff is collapsed.
fileFormatVersion: 2
guid: 46926d080847e63419c875a38c3714bd
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -7251,7 +7251,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99957, y: 0}
m_AnchoredPosition: {x: -399.99963, y: 0}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &129642814
......@@ -8176,7 +8176,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: -490.00006, y: 0}
m_AnchoredPosition: {x: -490.00012, y: 0}
m_SizeDelta: {x: 490, y: 2000}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &153416284
......@@ -10585,7 +10585,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &203992981
......@@ -13635,7 +13635,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &250597853
......@@ -16799,7 +16799,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1581995138}
m_Direction: 2
m_Value: 0
m_Size: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -16879,7 +16879,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &296823158
......@@ -19237,7 +19237,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99957, y: 300}
m_AnchoredPosition: {x: -399.99963, y: 300}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &365844423
......@@ -37505,7 +37505,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &681567863
......@@ -40276,7 +40276,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: -419.99957, y: -60}
m_AnchoredPosition: {x: -419.99963, y: -60}
m_SizeDelta: {x: 400, y: 760}
m_Pivot: {x: 0, y: 1}
--- !u!114 &736958434
......@@ -41825,7 +41825,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 476827028}
m_Direction: 2
m_Value: 1
m_Size: 0.62434137
m_Size: 0.6234872
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -54287,7 +54287,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 399.99957, y: -132}
m_AnchoredPosition: {x: 399.99963, y: -132}
m_SizeDelta: {x: 330, y: 840}
m_Pivot: {x: 1, y: 1}
--- !u!114 &998933908
......@@ -54748,7 +54748,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1005556390
......@@ -55482,7 +55482,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 948258731}
m_Direction: 2
m_Value: 0
m_Size: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -73369,7 +73369,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1371617110
......@@ -73521,7 +73521,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99957, y: 150}
m_AnchoredPosition: {x: -399.99963, y: 150}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1374530642
......@@ -81142,7 +81142,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 2083794100}
m_Direction: 2
m_Value: 0
m_Size: 0.55882347
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -98956,7 +98956,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99957, y: -150}
m_AnchoredPosition: {x: -399.99963, y: -150}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1800729521
......@@ -104111,7 +104111,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49957, y: -540}
m_AnchoredPosition: {x: 247.49963, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1895460095
......@@ -657,7 +657,6 @@ namespace MDPro3
else
return container.typeLevel;
}
public static Sprite GetCardCounterIcon(int counter)
{
switch (counter)
......
......@@ -184,7 +184,8 @@ namespace MDPro3
{
Dispose();
if (superScrollView != null)
superScrollView.Clear();
foreach (var item in superScrollView.items)
item.gameObject.GetComponent<SuperScrollViewItemForDeckEdit>().Dispose();
});
}
}
......
......@@ -20,7 +20,7 @@ namespace MDPro3
SuperScrollView superScrollView;
public Dictionary<string, Deck> decks = new Dictionary<string, Deck>();
public List<SuperScrollViewItemForDeck> items;
public List<SuperScrollViewItemForDeckSelect> items;
public ButtonSwitchForDeckPickup btnPickup;
public ToggleForDeckDelete btnDelete;
......@@ -53,7 +53,9 @@ namespace MDPro3
DOTween.To(v => { }, 0, 0, transitionTime).OnComplete(() =>
{
btnPickup.OnSwitchOff();
superScrollView.Clear();
if(superScrollView != null)
foreach (var item in superScrollView.items)
item.gameObject.GetComponent<SuperScrollViewItemForDeckSelect>().Dispose();
Clear();
depth = 1;
state = State.ForEdit;
......@@ -152,7 +154,7 @@ namespace MDPro3
void ItemOnListRefresh(string[] task, GameObject item)
{
var handler = item.GetComponent<SuperScrollViewItemForDeck>();
var handler = item.GetComponent<SuperScrollViewItemForDeckSelect>();
handler.deckName = task[0];
handler.deckCase = int.Parse(task[1]);
handler.card1 = int.Parse(task[2]);
......
......@@ -28,6 +28,8 @@ namespace MDPro3
public InputField inputHand;
public InputField inputDraw;
public GameObject btnDeck;
public static readonly int diyAI = 6;
public class BotInfo
{
public string name;
......@@ -154,7 +156,7 @@ namespace MDPro3
{
BotInfo bot = bots[aiCode];
string aiCommand = bot.command;
if (aiCode == 4)
if (aiCode == diyAI)
{
string selectedDeck = btnDeck.transform.GetChild(0).GetComponent<Text>().text;
if (!File.Exists("Deck/" + selectedDeck + ".ydk"))
......
......@@ -56,7 +56,7 @@ namespace MDPro3.UI
scrollView.verticalScrollbar.onValueChanged.AddListener(OnScrollBarChange);
}
public void Clear()
public virtual void Clear()
{
foreach (var item in items)
UnityEngine.Object.Destroy(item.gameObject);
......
......@@ -169,6 +169,18 @@ namespace MDPro3.UI
refreshed = true;
}
public void Dispose()
{
StartCoroutine(DisposeAsync());
}
IEnumerator DisposeAsync()
{
while(!refreshed)
yield return null;
Destroy(gameObject);
}
void OnClick(PointerEventData eventData)
{
if (!refreshed)
......
......@@ -7,7 +7,7 @@ using UnityEngine.UI;
namespace MDPro3.UI
{
public class SuperScrollViewItemForDeck : SuperScrollViewItem, IPointerEnterHandler, IPointerExitHandler
public class SuperScrollViewItemForDeckSelect : SuperScrollViewItem, IPointerEnterHandler, IPointerExitHandler
{
public string deckName;
public int deckCase;
......@@ -44,8 +44,10 @@ namespace MDPro3.UI
StartCoroutine(RefreshAsync());
}
bool refreshed;
IEnumerator RefreshAsync()
{
refreshed = false;
textName.text = deckName;
var casePath = deckCase.ToString();
var load = TextureManager.LoadItemIcon(casePath);
......@@ -125,6 +127,19 @@ namespace MDPro3.UI
cardFace3.texture = null;
cardFace3.material = pMat;
}
refreshed = true;
}
public void Dispose()
{
StartCoroutine(DisposeAsync());
}
IEnumerator DisposeAsync()
{
while(!refreshed)
yield return null;
Destroy(gameObject);
}
public override void OnClick()
......
......@@ -19,7 +19,7 @@ namespace MDPro3.UI
Program.I().solo.superScrollView.selected = id;
Program.I().solo.description.text = botInfo.desc;
Program.I().solo.description.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
if(id == 4)
if(id == Solo.diyAI)
Program.I().solo.btnDeck.SetActive(true);
else
Program.I().solo.btnDeck.SetActive(false);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment