Example #1
0
        public void Click_SP_Upgrade_Button()
        {
            if (_client == null || _client.IsConnected == false)
            {
                return;
            }

            var localPlayerProxy = _client.GetLocalPlayerProxy();

            localPlayerProxy.UpgradeSp();

            UI_InGame.Get().spUpgradeAnimator.SetTrigger("Fx_SP_Upgrade");

            SoundManager.instance.Play(Global.E_SOUND.SFX_INGAME_UI_SP_LEVEL_UP);
        }
Example #2
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));
        }
Example #3
0
        public virtual void StartManager()
        {
            var matchInfo = NetworkManager.Get().LastMatchInfo;

            NetworkManager.Get().LastMatchInfo = null;
            IsNetwork = matchInfo != null;
            if (IsNetwork)
            {
                StartMatchGame(matchInfo).Forget();
            }
            else
            {
                StartFakeGame().Forget();
            }

            UI_InGame.Get().ViewTargetDice(playType == PLAY_TYPE.CO_OP);

            //KZSee:AStarPathFinding MapScan
            //Invoke("MapScan", 1f);
        }
Example #4
0
        public void ShowAIField(bool isShow)
        {
            if (isShow)
            {
                var enemyPlayerState = _client.GetEnemyPlayerState();
                var tableManager     = TableManager.Get();
                var diceArr          = enemyPlayerState.Field.Select(f =>
                {
                    tableManager.DiceInfo.GetData(f.diceId, out var diceInfo);
                    return(new Dice()
                    {
                        diceFieldNum = f.index,
                        diceData = diceInfo
                    });
                }).ToArray();

                UI_DiceField.Get().SetField(diceArr);
                UI_DiceField.Get().RefreshField(0.5f);

                var deckArr = enemyPlayerState.Deck.Select(d =>
                {
                    TableManager.Get().DiceInfo.GetData(d.diceId, out var diceInfo);
                    return(diceInfo, d.inGameLevel);
                }).ToArray();

                UI_InGame.Get().SetArrayDeck(deckArr);
                int count = UI_InGame.Get().arrUpgradeButtons.Length;
                for (int i = 0; i < count; i++)
                {
                    UI_InGame.Get().arrUpgradeButtons[i].SetIconAlpha(0.5f);
                }

                _client.BindDeckUI(enemyPlayerState.userId);
            }
            else
            {
                var localPlayerState = _client.GetLocalPlayerState();
                var tableManager     = TableManager.Get();
                var diceArr          = localPlayerState.Field.Select(f =>
                {
                    tableManager.DiceInfo.GetData(f.diceId, out var diceInfo);
                    return(new Dice()
                    {
                        diceFieldNum = f.index,
                        diceData = diceInfo
                    });
                }).ToArray();

                UI_DiceField.Get().SetField(diceArr);
                UI_DiceField.Get().RefreshField();

                var deckArr = localPlayerState.Deck.Select(d =>
                {
                    TableManager.Get().DiceInfo.GetData(d.diceId, out var diceInfo);
                    return(diceInfo, d.inGameLevel);
                }).ToArray();

                UI_InGame.Get().SetArrayDeck(deckArr);
                int count = UI_InGame.Get().arrUpgradeButtons.Length;
                for (int i = 0; i < count; i++)
                {
                    UI_InGame.Get().arrUpgradeButtons[i].SetIconAlpha(0.5f);
                }

                _client.BindDeckUI(localPlayerState.userId);
            }
        }
Example #5
0
        public void Click_GetDiceButton()
        {
            if (_client == null || _client.IsConnected == false)
            {
                return;
            }

            var localPlayerState = _client.GetLocalPlayerState();
            var diceCost         = localPlayerState.GetDiceCost();

            if (localPlayerState == null)
            {
                return;
            }

            if (localPlayerState.sp >= diceCost && localPlayerState.GetEmptySlotCount() > 0)
            {
                if (TutorialManager.isTutorial)
                {
                    Debug.Log($"GetDiceCount: {TutorialManager.getDiceCount}");
                    switch (TutorialManager.getDiceCount)
                    {
                    case 0:
                        _client.GetLocalPlayerProxy().GetDice(2, 0);
                        break;

                    case 1:
                        _client.GetLocalPlayerProxy().GetDice(2, 1);
                        break;

                    case 2:
                        _client.GetLocalPlayerProxy().GetDice(2, 3);
                        break;

                    case 3:
                        _client.GetLocalPlayerProxy().GetDice(0, 6);
                        break;

                    case 4:
                        _client.GetLocalPlayerProxy().GetDice(0, 8);
                        break;

                    case 5:
                        _client.GetLocalPlayerProxy().GetDice(2, 4);
                        break;

                    case 6:
                        _client.GetLocalPlayerProxy().GetDice(2, 2);
                        break;

                    case 7:
                        _client.GetLocalPlayerProxy().GetDice(2, 5);
                        break;

                    case 8:
                        _client.GetLocalPlayerProxy().GetDice(2, 7);
                        break;

                    case 9:
                        _client.GetLocalPlayerProxy().GetDice(2, 9);
                        break;

                    case 10:
                        _client.GetLocalPlayerProxy().GetDice(2, 10);
                        break;

                    case 11:
                        _client.GetLocalPlayerProxy().GetDice(0, 11);
                        break;

                    case 12:
                        _client.GetLocalPlayerProxy().GetDice(3, 12);
                        break;

                    case 13:
                        _client.GetLocalPlayerProxy().GetDice(0, 13);
                        break;

                    case 14:
                        _client.GetLocalPlayerProxy().GetDice(2, 14);
                        break;

                    default:
                        _client.GetLocalPlayerProxy().GetRandomDice();
                        break;
                    }

                    RefreshField();
                }
                else
                {
                    UI_InGame.Get().ControlGetDiceButton(false);
                    var playerProxy = _client.GetLocalPlayerProxy();
                    playerProxy.GetRandomDice();
                }
            }
        }