|
@@ -690,14 +690,13 @@ public class ManaMiniGame : Regist
|
|
|
public static Transform D_Operate3;
|
|
|
|
|
|
public static List<int> IndexList = new List<int>();
|
|
|
+ public static List<int> FlowerIDListC = new List<int>();
|
|
|
public static List<Drop> DropList = new List<Drop>();
|
|
|
public static List<Flower> OpList = new List<Flower>();
|
|
|
public static List<Flower> IdleList = new List<Flower>();
|
|
|
public static List<Flower> FadeList = new List<Flower>();
|
|
|
- public static List<Flower> FlowerListC = new List<Flower>();
|
|
|
public static Dictionary<int, Flower> FlowerDic = new Dictionary<int, Flower>();
|
|
|
|
|
|
- public static int FlowerID;
|
|
|
public static int MiniGameIndex;
|
|
|
public static string ScoreLab;
|
|
|
|
|
@@ -737,6 +736,8 @@ public class ManaMiniGame : Regist
|
|
|
GameThreadA();
|
|
|
|
|
|
GameThreadB();
|
|
|
+
|
|
|
+ GameThreadC();
|
|
|
}
|
|
|
|
|
|
if (Prepare)
|
|
@@ -748,7 +749,7 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
private void GameThreadA()
|
|
|
{
|
|
|
- if (GameB)
|
|
|
+ if (!GameA)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -791,7 +792,7 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
private void GameThreadB()
|
|
|
{
|
|
|
- if (GameA)
|
|
|
+ if (!GameB)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -830,6 +831,35 @@ public class ManaMiniGame : Regist
|
|
|
BonusThread();
|
|
|
}
|
|
|
|
|
|
+ private void GameThreadC()
|
|
|
+ {
|
|
|
+ if (!GameC)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ GameTimer += Time.fixedDeltaTime;
|
|
|
+
|
|
|
+ if (GameTimer >= GameTime)
|
|
|
+ {
|
|
|
+ GameOver();
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Panalty)
|
|
|
+ {
|
|
|
+ PanaltyTimer -= Time.fixedDeltaTime;
|
|
|
+
|
|
|
+ if (PanaltyTimer <= 0)
|
|
|
+ {
|
|
|
+ Panalty = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ BonusThread();
|
|
|
+ }
|
|
|
+
|
|
|
private void BonusThread()
|
|
|
{
|
|
|
GoldTimer -= Time.fixedDeltaTime;
|
|
@@ -894,7 +924,46 @@ public class ManaMiniGame : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void Operate(int index, int slotIndex)
|
|
|
+ public static void OperateC(int id, int btnIndex)
|
|
|
+ {
|
|
|
+ if (!Game)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Panalty)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FlowerIDListC[0] == id)
|
|
|
+ {
|
|
|
+ Flower flower = IdleList.Find(tempFlower => { return tempFlower.ID == id; });
|
|
|
+
|
|
|
+ ManaReso.GetHudText("+50", Color.white, 90, flower.ChildDic["ScorePosTra"], ManaReso.Get("D_HudParent"), true);
|
|
|
+
|
|
|
+ Score += 50;
|
|
|
+
|
|
|
+ flower.PlayParticle();
|
|
|
+
|
|
|
+ ManaAudio.PlayClip(Clip.BtnClip);
|
|
|
+
|
|
|
+ RoundEndC();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Panalty = true;
|
|
|
+ PanaltyTimer = PanaltyTime;
|
|
|
+
|
|
|
+ ManaReso.Get("D_FlowerIcon" + btnIndex).TweenForGra();
|
|
|
+
|
|
|
+ ManaReso.Get("D_FlowerBtn" + btnIndex).Shake(0.5f, 3, new Vector3(20f, 0, 0), Curve.EaseOutQuad);
|
|
|
+
|
|
|
+ ManaAudio.PlayClip(Clip.ErrorClip);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void OperateB(int index, int slotIndex)
|
|
|
{
|
|
|
if (Panalty || !FadeList.Valid())
|
|
|
{
|
|
@@ -961,7 +1030,7 @@ public class ManaMiniGame : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void Operate(OpType opType)
|
|
|
+ public static void OperateA(OpType opType)
|
|
|
{
|
|
|
if (Panalty || !OpList.Valid())
|
|
|
{
|
|
@@ -1342,7 +1411,7 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
idList = new List<int>() {1, 2, 3, 4, 5, 6, 7, 8, 9};
|
|
|
|
|
|
- int special = idList.Random(true);
|
|
|
+ int special = idList.Random(1, true, true)[0];
|
|
|
|
|
|
Flower flower = ManaReso.GetFlower(ManaGarden.FlowerInfoDic[Award.FlowerID], ManaReso.Get("SlotMini" + special));
|
|
|
|
|
@@ -1422,7 +1491,7 @@ public class ManaMiniGame : Regist
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- int special = idList.Random(true);
|
|
|
+ int special = idList.Random(1, true, true)[0];
|
|
|
|
|
|
flower = ManaReso.GetFlower(ManaGarden.FlowerInfoDic[Award.FlowerID], ManaReso.Get("SlotMini" + special));
|
|
|
|
|
@@ -1463,41 +1532,17 @@ public class ManaMiniGame : Regist
|
|
|
ManaReso.SetActive("D_Begin", true);
|
|
|
ManaReso.SetActive("D_DescB", true);
|
|
|
|
|
|
+ ManaReso.SetActive("D_FlowerBtn7", false);
|
|
|
+ ManaReso.SetActive("D_FlowerBtn8", false);
|
|
|
+ ManaReso.SetActive("D_FlowerBtn9", false);
|
|
|
+
|
|
|
D_Begin.SetParent(D_Operate3);
|
|
|
D_Timer.SetParent(D_Status3);
|
|
|
D_Grid.SetParent(D_Status3);
|
|
|
|
|
|
PrepareLab.SetParent(ManaReso.Get("D_PrepareLayout3"));
|
|
|
|
|
|
-
|
|
|
- FlowerListC = new List<Flower>();
|
|
|
-
|
|
|
- List<int> slotList = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
|
|
-
|
|
|
-
|
|
|
- FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random(false, flowerIndo => { return flowerIndo.Unlock; });
|
|
|
-
|
|
|
- FlowerID = flowerInfo.ID_;
|
|
|
-
|
|
|
- FlowerListC.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + slotList.Random(true))));
|
|
|
-
|
|
|
- while (slotList.Count > 0)
|
|
|
- {
|
|
|
- flowerInfo = ManaGarden.FlowerInfoDic.Random(false, flowerIndo => { return flowerIndo.Unlock; });
|
|
|
-
|
|
|
- for (int i = 0; i < Mathf.Min(Random.Range(2, 9), slotList.Count); i++)
|
|
|
- {
|
|
|
- FlowerListC.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + slotList.Random(true))));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- for (int i = 0; i < FlowerListC.Count; i++)
|
|
|
- {
|
|
|
- FlowerListC[i].FlowerIcon.CreateTweenSr(1, 0, 0.25f, true, false, Curve.EaseOutQuad, false, true);
|
|
|
-
|
|
|
- FlowerListC[i].FlowerIcon.GetTweenSr().InDestination = true;
|
|
|
- }
|
|
|
+ RoundResetC(true);
|
|
|
}
|
|
|
|
|
|
public static void GameBegin()
|
|
@@ -1530,7 +1575,7 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
if (GameC)
|
|
|
{
|
|
|
- RoundBeginC();
|
|
|
+ RoundBeginC(true);
|
|
|
}
|
|
|
|
|
|
if (Random.Range(5, 9) <= MiniGameIndex)
|
|
@@ -1618,7 +1663,7 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
for (int i = 0; i < randomList.Count; i++)
|
|
|
{
|
|
|
- IndexList.Add(randomList.Random(true));
|
|
|
+ IndexList.Add(randomList.Random(1, true, true)[0]);
|
|
|
|
|
|
i--;
|
|
|
}
|
|
@@ -1639,23 +1684,132 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
public static void RoundEndC()
|
|
|
{
|
|
|
-
|
|
|
+ for (int i = 0; i < IdleList.Count; i++)
|
|
|
+ {
|
|
|
+ IdleList[i].FlowerIcon.TweenForSr();
|
|
|
+ }
|
|
|
+
|
|
|
+ ManaReso.Get("D_FlowerBtn7").TweenBacCG();
|
|
|
+ ManaReso.Get("D_FlowerBtn8").TweenBacCG();
|
|
|
+ ManaReso.Get("D_FlowerBtn9").TweenBacCG();
|
|
|
+
|
|
|
+ Auxiliary.Instance.DelayCall
|
|
|
+ (
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ if (Game)
|
|
|
+ {
|
|
|
+ RoundResetC();
|
|
|
+
|
|
|
+ RoundBeginC();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 1.5f
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
- public static void RoundResetC()
|
|
|
+ public static void RoundResetC(bool firstRound = false)
|
|
|
{
|
|
|
+ ExtList.ForEach(IdleList, flower => { flower.Retrieve(); });
|
|
|
+
|
|
|
+ IdleList = new List<Flower>();
|
|
|
+
|
|
|
+ FlowerIDListC = new List<int>();
|
|
|
|
|
|
+ List<int> slotList = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
|
|
+
|
|
|
+
|
|
|
+ FlowerInfo flowerInfo;
|
|
|
+
|
|
|
+ if (firstRound && !Award.FlowerLock)
|
|
|
+ {
|
|
|
+ flowerInfo = ManaGarden.FlowerInfoDic[Award.FlowerID];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ flowerInfo = ManaGarden.FlowerInfoDic.Random(false, flowerIndo => { return flowerIndo.Unlock; });
|
|
|
+ }
|
|
|
+
|
|
|
+ FlowerIDListC.Add(flowerInfo.ID_);
|
|
|
+
|
|
|
+ IdleList.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + slotList.Random(1, true, true)[0])));
|
|
|
+
|
|
|
+ while (slotList.Count > 0)
|
|
|
+ {
|
|
|
+ flowerInfo = ManaGarden.FlowerInfoDic.Random(false, info => { return info.Unlock && info.ID_ != FlowerIDListC[0]; });
|
|
|
+
|
|
|
+ if (slotList.Count == 1)
|
|
|
+ {
|
|
|
+ if (!FlowerIDListC.Contains(flowerInfo.ID_))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ FlowerIDListC.UniqueAdd(flowerInfo.ID_);
|
|
|
+ }
|
|
|
+
|
|
|
+ int amt = Mathf.Min(Random.Range(2, 9), slotList.Count);
|
|
|
+
|
|
|
+ for (int i = 0; i < amt; i++)
|
|
|
+ {
|
|
|
+ IdleList.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + slotList.Random(1, true, true)[0])));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < IdleList.Count; i++)
|
|
|
+ {
|
|
|
+ IdleList[i].FlowerIcon.CreateTweenSr(1, 0, 0.25f, true, false, Curve.EaseOutQuad, false, true);
|
|
|
+
|
|
|
+ IdleList[i].FlowerIcon.GetTweenSr().InDestination = true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<int> idList = new List<int>()
|
|
|
+ {
|
|
|
+ FlowerIDListC[0],
|
|
|
+ };
|
|
|
+
|
|
|
+ if (FlowerIDListC.Count == 2)
|
|
|
+ {
|
|
|
+ idList.Add(FlowerIDListC[1]);
|
|
|
+ idList.Add(FlowerIDListC[1]);
|
|
|
+ }
|
|
|
+ else if (FlowerIDListC.Count > 2)
|
|
|
+ {
|
|
|
+ idList.AddRange(FlowerIDListC.Random(2, true, false, id => { return id != idList[0]; }));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ idList = idList.Disturb();
|
|
|
+
|
|
|
+ ManaReso.SetSprite("D_FlowerIcon7", ManaGarden.FlowerInfoDic[idList[0]].Icon).Resize(true, 1f, 1f);
|
|
|
+ ManaReso.SetSprite("D_FlowerIcon8", ManaGarden.FlowerInfoDic[idList[1]].Icon).Resize(true, 1f, 1f);
|
|
|
+ ManaReso.SetSprite("D_FlowerIcon9", ManaGarden.FlowerInfoDic[idList[2]].Icon).Resize(true, 1f, 1f);
|
|
|
+
|
|
|
+ ManaReso.SetButtonEvent("D_FlowerBtn7", () => { OperateC(idList[0], 7); });
|
|
|
+ ManaReso.SetButtonEvent("D_FlowerBtn8", () => { OperateC(idList[1], 8); });
|
|
|
+ ManaReso.SetButtonEvent("D_FlowerBtn9", () => { OperateC(idList[2], 9); });
|
|
|
}
|
|
|
|
|
|
- public static void RoundBeginC()
|
|
|
+ public static void RoundBeginC(bool firstRound = false)
|
|
|
{
|
|
|
+ if (firstRound && !Award.FlowerLock)
|
|
|
+ {
|
|
|
+ IdleList[0].NewFlowerEffect.SetActive(true);
|
|
|
+ }
|
|
|
+
|
|
|
ManaReso.Get("D_FlowerBtn7").TweenReForCG();
|
|
|
ManaReso.Get("D_FlowerBtn8").TweenReForCG();
|
|
|
ManaReso.Get("D_FlowerBtn9").TweenReForCG();
|
|
|
|
|
|
- for (int i = 0; i < FlowerListC.Count; i++)
|
|
|
+ for (int i = 0; i < IdleList.Count; i++)
|
|
|
{
|
|
|
- FlowerListC[i].FlowerIcon.TweenBacSr();
|
|
|
+ IdleList[i].FlowerIcon.TweenBacSr();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1706,11 +1860,4 @@ public class ManaMiniGame : Regist
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-#region DebugList
|
|
|
-
|
|
|
-//结束界面的图标能否重复显示
|
|
|
-
|
|
|
-#endregion
|
|
|
+}
|