|
@@ -3,6 +3,7 @@ using UnityEngine;
|
|
|
using UI.ActivityGetYuanXiao;
|
|
|
using FairyGUI;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Threading.Tasks;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -19,10 +20,16 @@ namespace GFGGame
|
|
|
private bool _firstIn = true;
|
|
|
private bool _gamePause = false;
|
|
|
private float _timer;
|
|
|
-
|
|
|
+ private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
+ // Clear Effect
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
+ }
|
|
|
+
|
|
|
if (_ui != null)
|
|
|
{
|
|
|
_ui.Dispose();
|
|
@@ -42,6 +49,10 @@ namespace GFGGame
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hd_yx_bg_2");
|
|
|
_ui.m_collectList.itemRenderer = CollectListRenderer;
|
|
|
_ui.m_btnBack.onClick.Add(OnBtnBack);
|
|
|
+ _effectUIDic.Add("YXJ_Catch", EffectUIPool.CreateEffectUI(_ui.m_catcher.m_getEffect, "ui_Activity", "YXJ_Catch"));
|
|
|
+ _effectUIDic.Add("YXJ_text_start", EffectUIPool.CreateEffectUI(_ui.m_startEffect, "ui_Activity", "YXJ_text_start"));
|
|
|
+ _effectUIDic.Add("YXJ_gameing_bg_tx", EffectUIPool.CreateEffectUI(_ui.m_bgEffect, "ui_Activity", "YXJ_gameing_bg_tx"));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -204,6 +215,9 @@ namespace GFGGame
|
|
|
UpdateScore();
|
|
|
}
|
|
|
ShowFlyScore(item.GetScore());
|
|
|
+ _ui.m_catcher.m_getEffect.visible = false;
|
|
|
+ _ui.m_catcher.m_getEffect.visible = true;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void ShowFlyScore(int score)
|
|
@@ -232,14 +246,14 @@ namespace GFGGame
|
|
|
Timers.inst.AddUpdate(UpdateGame);
|
|
|
}
|
|
|
|
|
|
- private void PlayStartAnim()
|
|
|
+ private async void PlayStartAnim()
|
|
|
{
|
|
|
GRoot.inst.touchable = false;
|
|
|
- _ui.m_start.Play(() =>
|
|
|
- {
|
|
|
- GRoot.inst.touchable = true;
|
|
|
- StartGame();
|
|
|
- });
|
|
|
+ _ui.m_startEffect.visible = false;
|
|
|
+ _ui.m_startEffect.visible = true;
|
|
|
+ await Task.Delay(820);
|
|
|
+ GRoot.inst.touchable = true;
|
|
|
+ StartGame();
|
|
|
}
|
|
|
|
|
|
private void UpdateTime(object param)
|
|
@@ -305,6 +319,8 @@ namespace GFGGame
|
|
|
|
|
|
private void InitView()
|
|
|
{
|
|
|
+ _ui.m_startEffect.visible = false;
|
|
|
+ _ui.m_catcher.m_getEffect.visible = false;
|
|
|
_ui.m_catcher.m_flyscore.target.visible = false;
|
|
|
_ui.m_catcher.m_c2.selectedIndex = _cfg.id > PickUpGameArray.Instance.dataArray[0].id ? 1 : 0;
|
|
|
_ui.m_time.text = TimeUtil.FormattingTimeTo_mmss(_countTime * 1000);
|
|
@@ -387,6 +403,7 @@ namespace GFGGame
|
|
|
|
|
|
private void ResetGame()
|
|
|
{
|
|
|
+ HideGameView();
|
|
|
ShowGameView();
|
|
|
}
|
|
|
|