|
@@ -57,9 +57,23 @@ namespace GFGGame
|
|
|
private float waitTime = 0.0f;
|
|
|
private bool StartHit = true;
|
|
|
private bool firstHit = true;
|
|
|
+ private bool canHit = true;
|
|
|
|
|
|
+
|
|
|
+ private EffectUI _effectUI1;
|
|
|
+ private EffectUI _effectUI2;
|
|
|
+ private EffectUI _effectUI3;
|
|
|
+ private EffectUI _effectUI4;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
+ EffectUIPool.Recycle(_effectUI1);
|
|
|
+ _effectUI1 = null;
|
|
|
+ EffectUIPool.Recycle(_effectUI2);
|
|
|
+ _effectUI2 = null;
|
|
|
+ EffectUIPool.Recycle(_effectUI3);
|
|
|
+ _effectUI3 = null;
|
|
|
+ EffectUIPool.Recycle(_effectUI4);
|
|
|
+ _effectUI4 = null;
|
|
|
if (_ui != null)
|
|
|
{
|
|
|
_ui.Dispose();
|
|
@@ -79,6 +93,7 @@ namespace GFGGame
|
|
|
_ui.m_back.onClick.Add(OnClickBtnBack);
|
|
|
|
|
|
UIObjectFactory.SetPackageItemExtension("ui://MiniGame/CardComponent", typeof(Card));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -177,6 +192,7 @@ namespace GFGGame
|
|
|
}
|
|
|
StartHit = true;
|
|
|
firstHit = true;
|
|
|
+ canHit = true;
|
|
|
timeIndex = 0;
|
|
|
currentGameTime = gameTime;
|
|
|
cardNum = columns * rows;
|
|
@@ -211,6 +227,10 @@ namespace GFGGame
|
|
|
}
|
|
|
private void OnClickCardItem(EventContext context)
|
|
|
{
|
|
|
+ if(!canHit)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
GObject cardItem = context.sender as GObject;
|
|
|
Dictionary<string, int> cardInfo = (Dictionary<string, int>)cardItem.data;
|
|
|
UI_cardItem item = UI_cardItem.Proxy(_ui.m_cardList.GetChildAt(cardInfo["index"]));
|
|
@@ -255,9 +275,10 @@ namespace GFGGame
|
|
|
}
|
|
|
private void StartTime(object param = null)
|
|
|
{
|
|
|
- Timers.inst.Remove(StartTime);
|
|
|
_ui.m_cardList.touchable = false;
|
|
|
+ canHit = false;
|
|
|
UpdateCard();
|
|
|
+ Timers.inst.Remove(StartTime);
|
|
|
}
|
|
|
//这里是处理已翻开的数量
|
|
|
private void UpdateCard()
|
|
@@ -328,6 +349,7 @@ namespace GFGGame
|
|
|
Timers.inst.Remove(UpdateHit);
|
|
|
StartHit = true;
|
|
|
firstHit = true;
|
|
|
+ canHit = true;
|
|
|
_ui.m_cardList.touchable = true;
|
|
|
}
|
|
|
private void UpdateTime(object param = null)
|