|
@@ -28,7 +28,7 @@ namespace GFGGame
|
|
|
//进度条
|
|
|
private float barTime = 120.0f;
|
|
|
//行数
|
|
|
- private int rows = 0;
|
|
|
+ private int rows = 4;
|
|
|
//列数
|
|
|
private int columns = 4;
|
|
|
private int gameID;
|
|
@@ -50,7 +50,7 @@ namespace GFGGame
|
|
|
|
|
|
private List<ActivityOpenCfg> activityGameDate;
|
|
|
//假数据
|
|
|
- private int[] cardArray = new int[] { 1,1, 2,2, 3, 3 , 4, 4 , 5, 5 , 6, 6 , 8, 8 , 8, 8 };
|
|
|
+ private List<int> cardArray = new List<int> { 1,1, 2,2, 3, 3 , 4, 4 , 5, 5 , 6, 6 , 8, 8 , 8, 8 };
|
|
|
|
|
|
Card _c1 = new Card();
|
|
|
private float waitTime = 0.6f;
|
|
@@ -90,6 +90,7 @@ namespace GFGGame
|
|
|
gameID = 10001;
|
|
|
}
|
|
|
gameDate = CardGameArray.Instance.GetCfg(gameID);
|
|
|
+
|
|
|
UpdateView();
|
|
|
UpdateList();
|
|
|
}
|
|
@@ -126,7 +127,7 @@ namespace GFGGame
|
|
|
})
|
|
|
.SetRightButton(true, "确定", async (object data) =>
|
|
|
{
|
|
|
- var result = await MiniGameProxy.ReqMiniGameEnd(gameID, gameDate.type, timeIndex, false, activityGameDate[0].id);
|
|
|
+ var result = await MiniGameProxy.ReqMiniGameEnd(gameID, gameDate.type, timeIndex, false, activityGameDate[0].id,true);
|
|
|
if (!result) return;
|
|
|
this.Hide();
|
|
|
});
|
|
@@ -137,7 +138,7 @@ namespace GFGGame
|
|
|
UI_cardItem cardItem = UI_cardItem.Proxy(item);
|
|
|
Dictionary<string, int> itemInfo = new Dictionary<string, int>();
|
|
|
|
|
|
- //cardItem.m_card.GetChild("icon").icon = "ui://MiniGame/";
|
|
|
+ cardItem.m_card.GetChild("icon").icon = ResPathUtil.GetMiniGamePicPath(CardCfgArray.Instance.dataArray[cardArray[index]].resName);
|
|
|
if (cardItem.target.data == null)
|
|
|
{
|
|
|
cardItem.target.onClick.Add(OnClickCardItem);
|
|
@@ -173,13 +174,15 @@ namespace GFGGame
|
|
|
}
|
|
|
timeIndex = 0;
|
|
|
currentGameTime = gameTime;
|
|
|
+ cardNum = columns * rows;
|
|
|
currentCardNum = cardNum;
|
|
|
barTime = (float)gameTime;
|
|
|
needNum = 2;
|
|
|
activityGameDate = ActivityOpenCfgArray.Instance.GetCfgsBytype(ConstLimitTimeActivityType.ActLimitStlyc);
|
|
|
rand = new System.Random();
|
|
|
//洗牌
|
|
|
- RandomCardList(cardArray, cardArray.Length);
|
|
|
+ RandomGetNum();
|
|
|
+ RandomCardList(cardArray, cardArray.Count);
|
|
|
//
|
|
|
_ui.m_timeText.text = string.Format("{0}", currentGameTime);
|
|
|
_ui.m_ScareBar.max = gameTime;
|
|
@@ -327,7 +330,7 @@ namespace GFGGame
|
|
|
ViewManager.Show<ResultTipsView>(new object[] { isPass, gameDate.type, timeIndex, gameDate.id });
|
|
|
}
|
|
|
//洗牌
|
|
|
- private void RandomCardList(int[] array, int length)
|
|
|
+ private void RandomCardList(List<int> array, int length)
|
|
|
{
|
|
|
int index;
|
|
|
int value;
|
|
@@ -340,5 +343,21 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void RandomGetNum()
|
|
|
+ {
|
|
|
+ int numCount = CardCfgArray.Instance.dataArray.Length;
|
|
|
+ List<int> tArray = new List<int>();
|
|
|
+ for(int i=0;i<numCount;i++)
|
|
|
+ {
|
|
|
+ tArray.Add(i + 1);
|
|
|
+ }
|
|
|
+ RandomCardList(tArray, numCount);
|
|
|
+ for(int i = 0;i <cardNum;i+=2)
|
|
|
+ {
|
|
|
+ cardArray[i] = tArray[i];
|
|
|
+ cardArray[i + 1] = tArray[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|