public void SetPopupResult( Global.PLAY_TYPE playType, MatchPlayer localPlayer, MatchPlayer otherPlayer, bool view, bool winLose, int winningStreak, bool perfect, List <ItemBaseInfo> normalReward, List <ItemBaseInfo> streakReward, List <ItemBaseInfo> perfectReward, AdRewardInfo loseReward) { popup_Result.gameObject.SetActive(view); if (view) { popup_Result.Initialize(playType, localPlayer, otherPlayer, winLose, winningStreak, perfect, normalReward, streakReward, perfectReward, loseReward); } ViewGameIndicator(false); ShowLowHPEffect(false); SetViewWaiting(false); }
public void Initialize(Global.PLAY_TYPE playType, MatchPlayer localMatchPlayer, MatchPlayer otherMatchPlayer, bool winLose, int winningStreak, bool perfectGame, List <ItemBaseInfo> normalReward, List <ItemBaseInfo> streakReward, List <ItemBaseInfo> perfectReward, AdRewardInfo loseReward) { if (TutorialManager.isTutorial) { TutorialManager.stepCount++; } isWin = winLose; this.loseReward = loseReward; var localPlayerDeck = localMatchPlayer.Deck; var otherPlayerDeck = otherMatchPlayer.Deck; winlose_My.Initialize(isWin, perfectGame, winningStreak, localPlayerDeck.DiceInfos.Select(d => d.DiceId).ToArray(), localPlayerDeck.GuardianId, localMatchPlayer.UserNickName, localMatchPlayer.Trophy); winlose_Other.Initialize(!isWin, perfectGame, winningStreak, otherPlayerDeck.DiceInfos.Select(d => d.DiceId).ToArray(), otherPlayerDeck.GuardianId, otherMatchPlayer.UserNickName, otherMatchPlayer.Trophy); btn_ShowValues.interactable = false; // 경쟁전일경우 if (playType == Global.PLAY_TYPE.BATTLE) { int normalGold = 0; int normalTrophy = 0; int normalSeasonTrophy = 0; int normalRankTrophy = 0; int normalKey = 0; if (normalReward != null) { foreach (var reward in normalReward) { switch ((EItemListKey)reward.ItemId) { case EItemListKey.gold: //normalGold = reward.Value; rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.GOLD] = reward.Value; break; case EItemListKey.thropy: //normalTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.TROPHY] = reward.Value; break; case EItemListKey.seasonthropy: //normalSeasonTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.SEASON_TROPHY] = reward.Value; break; case EItemListKey.rankthropy: //normalRankTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.RANK_TROPHY] = reward.Value; break; case EItemListKey.key: //normalKey = reward.Value; rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.KEY] = reward.Value; break; } } } int streakGold = 0; int streakTrophy = 0; int streakSeasonTrophy = 0; int streakRankTrophy = 0; int streakKey = 0; if (streakReward != null) { foreach (var reward in streakReward) { switch ((EItemListKey)reward.ItemId) { case EItemListKey.gold: //normalGold = reward.Value; rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.GOLD] = reward.Value; break; case EItemListKey.thropy: //normalTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.TROPHY] = reward.Value; break; case EItemListKey.seasonthropy: //normalSeasonTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.SEASON_TROPHY] = reward.Value; break; case EItemListKey.rankthropy: //normalRankTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.RANK_TROPHY] = reward.Value; break; case EItemListKey.key: //normalKey = reward.Value; rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.KEY] = reward.Value; break; } } } int perfectGold = 0; int perfectTrophy = 0; int perfectSeasonTrophy = 0; int perfectRankTrophy = 0; int perfectKey = 0; if (perfectReward != null) { foreach (var reward in perfectReward) { switch ((EItemListKey)reward.ItemId) { case EItemListKey.gold: //normalGold = reward.Value; rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.GOLD] = reward.Value; break; case EItemListKey.thropy: //normalTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.TROPHY] = reward.Value; break; case EItemListKey.seasonthropy: //normalSeasonTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.SEASON_TROPHY] = reward.Value; break; case EItemListKey.rankthropy: //normalRankTrophy = reward.Value; rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.RANK_TROPHY] = reward.Value; break; case EItemListKey.key: //normalKey = reward.Value; rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.KEY] = reward.Value; break; } } } int totalTrophy = rewards[0, 0] + rewards[1, 0] + rewards[2, 0]; int totalGold = rewards[0, 1] + rewards[1, 1] + rewards[2, 1]; int totalKey = rewards[0, 2] + rewards[1, 2] + rewards[2, 2]; int totalSeasonTrophy = rewards[0, 3] + rewards[1, 3] + rewards[2, 3]; int totalRankTrophy = rewards[0, 4] + rewards[1, 4] + rewards[2, 4]; var userInfo = UserInfoManager.Get().GetUserInfo(); userInfo.trophy += totalTrophy; userInfo.seasonTrophy += totalSeasonTrophy; userInfo.rankPoint += totalRankTrophy; userInfo.gold += totalGold; userInfo.key += totalKey; } else // 협동전일경우 { var userInfo = UserInfoManager.Get().GetUserInfo(); TDataItemList data; for (int i = 0; normalReward != null && i < normalReward.Count; i++) { if (TableManager.Get().ItemList.GetData(normalReward[i].ItemId, out data)) { listBox.Add(data); if (userInfo.dicBox.ContainsKey(data.id)) { userInfo.dicBox[data.id] += normalReward[i].Value; } else { userInfo.dicBox.Add(data.id, normalReward[i].Value); } } } for (int i = 0; streakReward != null && i < streakReward.Count; i++) { if (TableManager.Get().ItemList.GetData(streakReward[i].ItemId, out data)) { listBox.Add(data); if (userInfo.dicBox.ContainsKey(data.id)) { userInfo.dicBox[data.id] += streakReward[i].Value; } else { userInfo.dicBox.Add(data.id, streakReward[i].Value); } } } for (int i = 0; perfectReward != null && i < perfectReward.Count; i++) { if (TableManager.Get().ItemList.GetData(perfectReward[i].ItemId, out data)) { listBox.Add(data); if (userInfo.dicBox.ContainsKey(data.id)) { userInfo.dicBox[data.id] += perfectReward[i].Value; } else { userInfo.dicBox.Add(data.id, perfectReward[i].Value); } } } } Invoke("EnableShowValuesButton", 2f); }