|
@@ -6,6 +6,7 @@ using FairyGUI;
|
|
|
using System.Threading;
|
|
|
using System.Threading.Tasks;
|
|
|
using System;
|
|
|
+using Random = UnityEngine.Random;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -22,7 +23,8 @@ namespace GFGGame
|
|
|
// private List<GoWrapper> _wrappers1 = new List<GoWrapper>();
|
|
|
private Dictionary<int, List<GameObject>> dicGameobj = new Dictionary<int, List<GameObject>>();
|
|
|
private Dictionary<int, List<GoWrapper>> dicWraper = new Dictionary<int, List<GoWrapper>>();
|
|
|
-
|
|
|
+ private List<GameObject> lineObj = new List<GameObject>();
|
|
|
+ private List<GoWrapper> lineWrapper = new List<GoWrapper>();
|
|
|
private GObject curComStar;//当前选中的星星
|
|
|
private Vector2 lastPos;//鼠标的上一个位置,每颗星星初始时默认为Vector2.right;
|
|
|
|
|
@@ -51,7 +53,7 @@ namespace GFGGame
|
|
|
UI_ComStar comStar = UI_ComStar.Proxy(star);
|
|
|
for (int i = comStar.target.numChildren - 1; i >= 0; i--)
|
|
|
{
|
|
|
- if (comStar.target.GetChildAt(i).name == "imgLine") continue;
|
|
|
+ if (comStar.target.GetChildAt(i).name == "comLine") continue;
|
|
|
comStar.target.RemoveChildAt(i);
|
|
|
}
|
|
|
index++;
|
|
@@ -67,6 +69,10 @@ namespace GFGGame
|
|
|
SceneController.DestroyObjectFromView(value[i], wrappersValue[i]);
|
|
|
}
|
|
|
}
|
|
|
+ for (int i = 0; i < lineObj.Count; i++)
|
|
|
+ {
|
|
|
+ SceneController.DestroyObjectFromView(lineObj[i], lineWrapper[i]);
|
|
|
+ }
|
|
|
notClickComStars.Clear();
|
|
|
clickComStars.Clear();
|
|
|
dicGameobj.Clear();
|
|
@@ -98,8 +104,8 @@ namespace GFGGame
|
|
|
|
|
|
_isLuckyBox = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(LuckyBoxDataManager.Instance.currentBoxId) >= 0;
|
|
|
_ui.m_ctrlRewardsType.selectedIndex = _isLuckyBox ? (LuckyBoxDataManager.Instance.currentBoxId - 1) : 0;
|
|
|
- string resPath = string.Format("cj_tp_{0}", _isLuckyBox ? LuckyBoxDataManager.Instance.currentBoxId : 1);
|
|
|
- _ui.m_bg.url = ResPathUtil.GetBgImgPath(resPath);
|
|
|
+ // string resPath = string.Format("cj_tp_{0}", _isLuckyBox ? LuckyBoxDataManager.Instance.currentBoxId : 1);
|
|
|
+ _ui.m_bg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
|
|
|
|
ResetStartView();
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
@@ -124,22 +130,26 @@ namespace GFGGame
|
|
|
comStar.m_comLine.target.width = imgLineWidth;
|
|
|
comStar.m_comLine.target.rotation = 0;
|
|
|
|
|
|
-
|
|
|
- GComponent gcom = CreateEffect(comStar, 1, "ui_ck"); ;
|
|
|
+ float scale = Random.Range(0.5f, 1f);
|
|
|
+ float rotation = Random.Range(0, 360);
|
|
|
+ GComponent gcom = CreateEffect(comStar, 1, _isLuckyBox ? "STAR_Ready_Bule" : "STAR_Ready"); ;
|
|
|
gcom.visible = true;
|
|
|
comStar.target.AddChildAt(gcom, 1);
|
|
|
+ gcom.scale = new Vector2(scale, scale);
|
|
|
+ gcom.rotation = rotation;
|
|
|
|
|
|
- GComponent gcom1 = CreateEffect(comStar, 2, "ui_ck_dj");
|
|
|
+ GComponent gcom1 = CreateEffect(comStar, 2, _isLuckyBox ? "STAR_Bule" : "STAR");
|
|
|
gcom1.visible = false;
|
|
|
comStar.target.AddChildAt(gcom1, 2);
|
|
|
+ gcom1.scale = new Vector2(scale, scale);
|
|
|
|
|
|
- GComponent gcom2 = CreateEffect(comStar, 3, "ui_ck_xs");
|
|
|
- gcom2.visible = false;
|
|
|
- comStar.target.AddChildAt(gcom2, 3);
|
|
|
+ // GComponent gcom2 = CreateEffect(comStar, 3, "ui_ck_xs");
|
|
|
+ // gcom2.visible = false;
|
|
|
+ // comStar.target.AddChildAt(gcom2, 3);
|
|
|
|
|
|
- GComponent gcom3 = CreateEffect(comStar, 4, "ui_ck_dj_2");
|
|
|
- gcom3.visible = false;
|
|
|
- comStar.target.AddChildAt(gcom3, 4);
|
|
|
+ // GComponent gcom3 = CreateEffect(comStar, 4, "ui_ck_dj_2");
|
|
|
+ // gcom3.visible = false;
|
|
|
+ // comStar.target.AddChildAt(gcom3, 4);
|
|
|
|
|
|
|
|
|
|
|
@@ -162,7 +172,7 @@ namespace GFGGame
|
|
|
else
|
|
|
{
|
|
|
gcom = UIPackage.CreateObject("LuckyBox", "ComHolder").asCom;
|
|
|
- string resPath = ResPathUtil.GetViewEffectPath("ui_ck", name);
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_LuckyBox", name);
|
|
|
SceneController.AddObjectToView(null, null, gcom.GetChild("holder").asGraph, resPath, out GameObject gameObject, out GoWrapper wrapper);
|
|
|
if (!dicGameobj.ContainsKey(index))
|
|
|
{
|
|
@@ -208,9 +218,13 @@ namespace GFGGame
|
|
|
}
|
|
|
UI_ComStar comStar = UI_ComStar.Proxy(comStars[i]);
|
|
|
comStar.target.GetChildAt(2).asCom.visible = true;
|
|
|
- comStar.target.GetChildAt(1).asCom.visible = false;
|
|
|
+ // comStar.target.GetChildAt(1).asCom.visible = false;
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_LuckyBox", _isLuckyBox ? "LINE_Bule" : "LINE");
|
|
|
+ SceneController.AddObjectToView(null, null, comStar.m_comLine.m_holder, resPath, out GameObject gameObject, out GoWrapper wrapper);
|
|
|
+ lineObj.Add(gameObject);
|
|
|
+ lineWrapper.Add(wrapper);
|
|
|
UI_ComStar.ProxyEnd();
|
|
|
- // comStar.m_c1.selectedIndex = 1;
|
|
|
+
|
|
|
curComStar = comStars[i];
|
|
|
lastPos = Vector2.right;
|
|
|
|
|
@@ -261,55 +275,55 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- CheckNotClickComStar();
|
|
|
- SetComStarDarken();
|
|
|
+ // CheckNotClickComStar();
|
|
|
+ // SetComStarDarken();
|
|
|
RemoveListener();
|
|
|
- Timers.inst.Add(1f, 1, SetClickComStarAni);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- private void CheckNotClickComStar()
|
|
|
- {
|
|
|
- int index = 0;
|
|
|
- GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
|
|
|
-
|
|
|
- while (star != null && star.visible == true)
|
|
|
- {
|
|
|
- if (clickComStars.IndexOf(star) < 0)
|
|
|
- {
|
|
|
- notClickComStars.Add(star);
|
|
|
- }
|
|
|
- index++;
|
|
|
- star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void SetComStarDarken()
|
|
|
- {
|
|
|
-
|
|
|
- for (int i = 0; i < notClickComStars.Count; i++)
|
|
|
- {
|
|
|
- UI_ComStar notClickComStar = UI_ComStar.Proxy(notClickComStars[i]);
|
|
|
- notClickComStar.m_comLine.target.visible = false;
|
|
|
- notClickComStar.target.GetChildAt(3).asCom.visible = true;
|
|
|
- notClickComStar.target.GetChildAt(1).asCom.visible = false;
|
|
|
- UI_ComStar.ProxyEnd();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void SetClickComStarAni(object param)
|
|
|
- {
|
|
|
- for (int i = 0; i < clickComStars.Count; i++)
|
|
|
- {
|
|
|
- UI_ComStar comStar = UI_ComStar.Proxy(clickComStars[i]);
|
|
|
- comStar.target.GetChildAt(4).asCom.visible = true;
|
|
|
- UI_ComStar.ProxyEnd();
|
|
|
-
|
|
|
+ // Timers.inst.Add(1f, 1, SetClickComStarAni);
|
|
|
+ Timers.inst.Add(0.5f, 1, SetEndEffect);
|
|
|
}
|
|
|
- Timers.inst.Add(0.5f, 1, SetEndEffect);
|
|
|
}
|
|
|
+ // private void CheckNotClickComStar()
|
|
|
+ // {
|
|
|
+ // int index = 0;
|
|
|
+ // GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
|
|
|
+
|
|
|
+ // while (star != null && star.visible == true)
|
|
|
+ // {
|
|
|
+ // if (clickComStars.IndexOf(star) < 0)
|
|
|
+ // {
|
|
|
+ // notClickComStars.Add(star);
|
|
|
+ // }
|
|
|
+ // index++;
|
|
|
+ // star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private void SetComStarDarken()
|
|
|
+ // {
|
|
|
+
|
|
|
+ // for (int i = 0; i < notClickComStars.Count; i++)
|
|
|
+ // {
|
|
|
+ // UI_ComStar notClickComStar = UI_ComStar.Proxy(notClickComStars[i]);
|
|
|
+ // notClickComStar.m_comLine.target.visible = false;
|
|
|
+ // notClickComStar.target.GetChildAt(3).asCom.visible = true;
|
|
|
+ // notClickComStar.target.GetChildAt(1).asCom.visible = false;
|
|
|
+ // UI_ComStar.ProxyEnd();
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private void SetClickComStarAni(object param)
|
|
|
+ // {
|
|
|
+ // for (int i = 0; i < clickComStars.Count; i++)
|
|
|
+ // {
|
|
|
+ // UI_ComStar comStar = UI_ComStar.Proxy(clickComStars[i]);
|
|
|
+ // comStar.target.GetChildAt(4).asCom.visible = true;
|
|
|
+ // UI_ComStar.ProxyEnd();
|
|
|
+
|
|
|
+ // }
|
|
|
+ // Timers.inst.Add(0.5f, 1, SetEndEffect);
|
|
|
+ // }
|
|
|
private void SetEndEffect(object param)
|
|
|
{
|
|
|
_ui.m_effEnd.visible = true;
|