|
|
|
@ -43,6 +43,7 @@ public class PlayerStatsManager : Singleton <PlayerStatsManager> |
|
|
|
|
|
|
|
ReadItemInforCsv(itemCsvFilePath); |
|
|
|
ReadItemLimitCsv(itemLimitCsvFilePath); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//选项效果==加一个同步UI的订阅系统
|
|
|
|
@ -201,4 +202,46 @@ public class PlayerStatsManager : Singleton <PlayerStatsManager> |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//获取卡牌颜色比例
|
|
|
|
public List<int> GetCardDeckColor(List<string> cards) |
|
|
|
{ |
|
|
|
List <int> colorCountList = new List<int>() { 0, 0, 0, 0, 0, 0, 0 };//1red,2white,3blue,4green,5black,6matel,0是费用总数
|
|
|
|
CardOriginalData cardOriginalData; |
|
|
|
for (int i = 0; i < cards.Count; i++) |
|
|
|
{ |
|
|
|
if (CardOriginalDataList.Instance.existCardOriginalDataList.TryGetValue(cards[i], out cardOriginalData) == true) |
|
|
|
{ |
|
|
|
//统计颜色牌颜色和费用
|
|
|
|
colorCountList[0] += cardOriginalData.Cost; |
|
|
|
foreach (string color in cardOriginalData.nodesColor) |
|
|
|
{ |
|
|
|
colorCountList[Name.stringColorToint(color)] += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
else//统计效果牌费用
|
|
|
|
{ |
|
|
|
if (CardOriginalDataList.Instance.existEffectCardOriginalDataList.TryGetValue(cards[i], out cardOriginalData) == true) |
|
|
|
{ |
|
|
|
|
|
|
|
colorCountList[0] += cardOriginalData.Cost; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
int colorTotalCount = 0;//计算颜色总数
|
|
|
|
for (int i = 1; i < colorCountList.Count; i++) |
|
|
|
{ |
|
|
|
colorTotalCount += colorCountList[i]; |
|
|
|
} |
|
|
|
//计算单个颜色占比有多少个
|
|
|
|
List<int> colorResults = new List<int>() { 0, 0, 0, 0, 0, 0, 0 };//1red,2white,3blue,4green,5black,6matel,0是费用总数
|
|
|
|
colorResults[0] = colorCountList [0]; |
|
|
|
for (int i = 1; i < colorCountList.Count; i++) |
|
|
|
{ |
|
|
|
colorResults[i] = (int)(((float)colorCountList[i]/ (float)colorTotalCount )*colorResults[0]); |
|
|
|
Debug.Log("涂色" + i + ":"+ colorResults[i]); |
|
|
|
} |
|
|
|
Debug.Log("涂色总数:" + colorResults[0]); |
|
|
|
return colorResults; |
|
|
|
} |
|
|
|
} |
|
|
|
|