Пример #1
0
        //KZSee: 결과처리
        IEnumerator EndGameCoroutine(Global.PLAY_TYPE playType, MatchPlayer localPlayer, MatchPlayer otherPlayer, MatchReport result)
        {
            yield return(new WaitForSeconds(4f));

            //KZSee: 이벤트로그
            //playerController.SendEventLog_BatCheck();

            UI_InGamePopup.Get().SetPopupResult(playType, localPlayer, otherPlayer, true, result.WinLose, result.WinStreak, result.IsPerfect, result.NormalRewards, result.StreakRewards, result.PerfectRewards, result.LoseReward);

            SoundManager.instance.Play(result.WinLose ? Global.E_SOUND.BGM_INGAME_WIN : Global.E_SOUND.BGM_INGAME_LOSE);
        }
Пример #2
0
 private void ADCallback(bool b)
 {
     if (b)
     {
         UI_InGamePopup.Get().obj_Indicator.SetActive(true);
         NetworkManager.session.UserTemplate.UserAdRewardReq(NetworkManager.session.HttpClient,
                                                             loseReward.RewardId, ADRewardCallback);
     }
     else
     {
         InGameManager.Get().OnClickExit();
     }
 }
Пример #3
0
        public void EndGame(Global.PLAY_TYPE playType, MatchPlayer local, MatchPlayer other, MatchReport result)
        {
            UI_InGamePopup.Get().SetViewWaiting(false);

            // 인디케이터도 다시 안보이게..
            if (UI_InGamePopup.Get().IsIndicatorActive() == true)
            {
                UI_InGamePopup.Get().ViewGameIndicator(false);
            }

            StopAllCoroutines();
            SoundManager.instance?.StopBGM();
            BroadcastMessage("EndGameUnit", SendMessageOptions.DontRequireReceiver);
            UI_InGame.Get().ClearUI();

            StartCoroutine(EndGameCoroutine(playType, local, other, result));
        }
Пример #4
0
    IEnumerator ShowResultValuesCoroutine()
    {
        Ease ease = Ease.InBack;

        if (InGameManager.Get().playType == PLAY_TYPE.BATTLE)
        {
            ((RectTransform)winlose_Other.transform).DOAnchorPosY(520 + 1200, 0.5f).SetEase(ease);
            ((RectTransform)winlose_My.transform).DOAnchorPosY(-320 + 520, 0.5f).SetEase(ease).SetDelay(0.1f);
            yield return(new WaitForSeconds(0.6f));

            if (isWin)
            {
                text_Win_Trophy.gameObject.SetActive(true);
                text_Win_Trophy.transform.DOPunchScale(Vector3.one * 0.1f, 0.2f);
                text_Win_Gold.transform.DOPunchScale(Vector3.one * 0.1f, 0.2f).SetDelay(0.1f).OnStart(() =>
                {
                    text_Win_Gold.gameObject.SetActive(true);
                });
                text_Win_Key.transform.DOPunchScale(Vector3.one * 0.1f, 0.2f).SetDelay(0.2f).OnStart(() =>
                {
                    text_Win_Key.gameObject.SetActive(true);
                });
            }
            else
            {
                text_Lose_Trophy.gameObject.SetActive(true);
                text_Lose_Trophy.transform.DOPunchScale(Vector3.one * 0.1f, 0.2f);
                text_Lose_Gold.transform.DOPunchScale(Vector3.one * 0.1f, 0.2f).SetDelay(0.1f).OnStart(() =>
                {
                    text_Lose_Gold.gameObject.SetActive(true);
                });
            }

            yield return(new WaitForSeconds(0.4f));

            Text text_MyRankPoint = winlose_My.text_Trophy;

            if (rewards[0, 0] != 0 || rewards[0, 1] > 0 || rewards[0, 2] > 0 || rewards[0, 4] != 0)
            {
                if (isWin)
                {
                    SetRewardMessage("Normal rewards !");
                }
                yield return(new WaitForSeconds(0.3f));

                if (rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.TROPHY] != 0)
                {
                    if (isWin)
                    {
                        StartCoroutine(TextCoroutine(text_Win_Trophy,
                                                     rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.TROPHY], true));
                    }
                    else
                    {
                        StartCoroutine(TextCoroutine(text_Lose_Trophy,
                                                     rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.TROPHY], true));
                    }
                }

                if (rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.GOLD] > 0)
                {
                    if (isWin)
                    {
                        StartCoroutine(TextCoroutine(text_Win_Gold,
                                                     rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.GOLD]));
                    }
                    else
                    {
                        StartCoroutine(TextCoroutine(text_Lose_Gold,
                                                     rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.GOLD]));
                    }
                }

                if (rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.KEY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Key,
                                                 rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.KEY]));
                }

                if (rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.RANK_TROPHY] != 0)
                {
                    StartCoroutine(TextCoroutine(text_MyRankPoint,
                                                 rewards[(int)REWARD_CATEGORY.NORMAL, (int)REWARD_TYPE.RANK_TROPHY]));
                }

                yield return(new WaitForSeconds(1f));

                yield return(new WaitForSeconds(0.3f));
            }

            if (rewards[1, 0] > 0 || rewards[1, 1] > 0 || rewards[1, 2] > 0 || rewards[1, 4] > 0)
            {
                SetRewardMessage("Winstreak rewards !");
                yield return(new WaitForSeconds(0.3f));

                if (rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.TROPHY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Trophy,
                                                 rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.TROPHY], true));
                }

                if (rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.GOLD] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Gold,
                                                 rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.GOLD]));
                }

                if (rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.KEY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Key,
                                                 rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.KEY]));
                }

                if (rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.RANK_TROPHY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_MyRankPoint,
                                                 rewards[(int)REWARD_CATEGORY.WINSTREAK, (int)REWARD_TYPE.RANK_TROPHY]));
                }

                yield return(new WaitForSeconds(1f));

                yield return(new WaitForSeconds(0.3f));
            }

            if (rewards[2, 0] > 0 || rewards[2, 1] > 0 || rewards[2, 2] > 0 || rewards[2, 4] > 0)
            {
                SetRewardMessage("Perfect rewards !");
                yield return(new WaitForSeconds(0.3f));

                if (rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.TROPHY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Trophy,
                                                 rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.TROPHY], true));
                }

                if (rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.GOLD] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Gold,
                                                 rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.GOLD]));
                }

                if (rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.KEY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_Win_Key,
                                                 rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.KEY]));
                }

                if (rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.RANK_TROPHY] > 0)
                {
                    StartCoroutine(TextCoroutine(text_MyRankPoint,
                                                 rewards[(int)REWARD_CATEGORY.PERFECT, (int)REWARD_TYPE.RANK_TROPHY]));
                }

                yield return(new WaitForSeconds(1f));

                yield return(new WaitForSeconds(0.3f));
            }
        }
        else // 협동전일경우
        {
            bool isWait = true;
            //((RectTransform) winlose_Other.transform).DOAnchorPosY(520 + 200, 0.5f).SetEase(ease);
            ((RectTransform)winlose_My.transform).DOAnchorPosY(-320 - 200, 0.5f).SetEase(ease).SetDelay(0.1f);
            ease = Ease.OutBack;
            rts_CoopIcon.gameObject.SetActive(true);
            rts_CoopIcon.localScale = Vector3.zero;
            rts_CoopIcon.DOScale(1f, 0.3f).SetEase(ease).OnComplete(() =>
            {
                rts_CoopIcon.DOScale(1.1f, 0.3f).SetLoops(2, LoopType.Yoyo).OnComplete(() =>
                {
                    rts_CoopIcon.DOScale(0f, 0.3f).SetEase(ease).OnComplete(() =>
                    {
                        rts_CoopIcon.gameObject.SetActive(false);
                        rts_ScrollView.gameObject.SetActive(true);
                        rts_ScrollView.localScale = Vector3.zero;
                        rts_ScrollView.DOScale(1f, 0.5f).SetEase(ease).OnComplete(() => { isWait = false; });
                    });
                });
            });

            while (isWait)
            {
                yield return(null);
            }

            float width = GetComponentInParent <CanvasScaler>().referenceResolution.x;
            for (int i = 0; i < listBox.Count; i++)
            {
                var obj = Instantiate(pref_CoopRewardSlot, Vector3.zero, Quaternion.identity, rts_CoopRewardContent);
                obj.transform.localRotation = Quaternion.identity;
                obj.transform.localScale    = Vector3.zero;
                obj.transform.DOScale(1f, 0.1f).SetEase(ease);
                obj.GetComponentInChildren <UnityEngine.UI.Image>().sprite = FileHelper.GetIcon(listBox[i].itemIcon);
                LayoutRebuilder.ForceRebuildLayoutImmediate(rts_CoopRewardContent);
                if (rts_CoopRewardContent.sizeDelta.x > width)
                {
                    rts_CoopRewardContent.DOAnchorPosX(-(rts_CoopRewardContent.sizeDelta.x - width), 0.5f);
                }

                yield return(new WaitForSeconds(0.1f));
            }
        }

        // for (int i = 0; i < arrValue.Length; i++)
        // {
        //     arrValue[i].gameObject.SetActive(true);
        //     arrValue[i].transform.localScale = Vector3.zero;
        //     arrValue[i].transform.DOScale(Vector3.one, 0.3f).SetEase(ease);
        //     //arrValue[i].Initialize(9999, 9999, 9999);
        //     yield return new WaitForSeconds(0.15f);
        // }

        yield return(new WaitForSeconds(0.5f));

        btn_End.gameObject.SetActive(true);
        ((RectTransform)btn_End.transform).DOScale(Vector3.one, 0.3f).SetEase(ease).OnStart(() =>
        {
            btn_End.transform.localScale = Vector3.zero;
        });

        if (loseReward != null && string.IsNullOrEmpty(loseReward.RewardId) == false)
        {
            // TDataItemList data;
            // TableManager.Get().ItemList.GetData(loseReward.ItemId, out data);
            {
                btn_AD.gameObject.SetActive(true);
                //image_ADReward_Icon.sprite = FileHelper.GetIcon(data.itemIcon);
                text_ADReward_Count.text = $"x{loseReward.Value}";
                btn_AD.onClick.AddListener(() =>
                {
#if UNITY_EDITOR
                    UI_InGamePopup.Get().obj_Indicator.SetActive(true);
                    NetworkManager.session.UserTemplate.UserAdRewardReq(NetworkManager.session.HttpClient,
                                                                        loseReward.RewardId, ADRewardCallback);
#else
                    ShowAdd();
#endif
                });
            }

            ((RectTransform)btn_AD.transform).DOScale(Vector3.one, 0.3f).SetEase(ease).OnStart(() =>
            {
                btn_AD.transform.localScale = Vector3.zero;
            });
        }
    }