예제 #1
0
    public override void Init(int charTableId, Vector3 vPos)
    {
        base.Init(charTableId, vPos);

        CardListUI_Remain = PFUtil.Instantiate <APFCardListUI>(PFPrefabPath.CardListUI, this.gameObject, Vector3.zero);
        CardListUI_Remain.gameObject.SetActive(false);
        CardListUI_Remain.Title_UILabel.text = PFConst.StrRemainCard;

        CardListUI_Used = PFUtil.Instantiate <APFCardListUI>(PFPrefabPath.CardListUI, this.gameObject, Vector3.zero);
        CardListUI_Used.gameObject.SetActive(false);
        CardListUI_Used.Title_UILabel.text = PFConst.StrUsedCard;

        CardListUI_Destroyed = PFUtil.Instantiate <APFCardListUI>(PFPrefabPath.CardListUI, this.gameObject, Vector3.zero);
        CardListUI_Destroyed.gameObject.SetActive(false);
        CardListUI_Destroyed.Title_UILabel.text = PFConst.StrDestroyedCard;

        PFPlayerCharacter = PFCharacter as APFPlayerCharacter;

        List <int> totalCardList = PFPlayerStuff.GetInitTotalCardList();

        CardPool[PFCardPool.RemainCard] = totalCardList;

        APFGameMode gameMode = APFGameMode.GetInstance();

        gameMode.OnClick_Character_Dele += OnClick_Character;
    }
예제 #2
0
    public override void OnTurnBegin()
    {
        base.OnTurnBegin();

        TurnEndBtn.SetActive(true);

        SetCost(PFConst.DefaultPlayerMaxCost);

        RemoveAllCard_InDeckUI();

        //덱카드 갱신
        CardPool[PFCardPool.DeckCard].Clear();

        if (CardPool[PFCardPool.RemainCard].Count < PFConst.InitDeckCardCount)
        {
            CardPool[PFCardPool.RemainCard].AddRange(CardPool[PFCardPool.UsedCard]);

            CardPool[PFCardPool.UsedCard].Clear();
            ShowUsedCardBtn.CardCount_UILabel.text = CardPool[PFCardPool.UsedCard].Count.ToString();
            CardListUI_Used.UpdateUI_CardList(CardPool[PFCardPool.UsedCard]);
        }

        CardPool[PFCardPool.DeckCard] = PFUtil.GetRandomList(CardPool[PFCardPool.RemainCard], PFConst.InitDeckCardCount, true);

        DeckCardList = PFPlayerStuff.Create_DeckCards(DeckCardParent, CardPool[PFCardPool.DeckCard], PFConst.WidthResolution);

        //남은카드 갱신
        PFPlayerStuff.RemoveTargetComponent(CardPool[PFCardPool.RemainCard], CardPool[PFCardPool.DeckCard]);

        CardListUI_Remain.UpdateUI_CardList(CardPool[PFCardPool.RemainCard]);

        ShowRemainCardBtn.CardCount_UILabel.text = CardPool[PFCardPool.RemainCard].Count.ToString();

        Enable_DeckCard_OnClickEvent(true);
    }
예제 #3
0
    private EGameResult OnCharacterDead(APFCharacterController targetCtrl)
    {
        targetCtrl.OnCharacterDead();

        DeadCharCtrlList.Add(targetCtrl);
        AliveCharCtrlList.Remove(targetCtrl);

        APFPlayerController plrCtrl = PFPlayerStuff.GetPlayerController(AliveCharCtrlList);

        if (plrCtrl == null)
        {
            return(EGameResult.Defeat);
        }
        else if (plrCtrl != null && AliveCharCtrlList.Count == 1)
        {
            return(EGameResult.Victory);
        }

        return(EGameResult.InProgress);
    }
예제 #4
0
    private void StartGamePlay()
    {
        TurnCharacter = null;

        TurnInfoUI_Player.SetActive(false);
        TurnInfoUI_Monster.SetActive(false);

        GameOverUI.gameObject.SetActive(false);

        for (int i = 0; i < AliveCharCtrlList.Count; ++i)
        {
            AliveCharCtrlList[i].StartGamePlay();
        }

        APFPlayerController plrController = PFPlayerStuff.GetPlayerController(AliveCharCtrlList);

        if (plrController != null)
        {
            TurnBegin(plrController);
        }
    }
예제 #5
0
    public APFPlayerController GetPlayer()
    {
        APFPlayerController plrController = PFPlayerStuff.GetPlayerController(AliveCharCtrlList);

        return(plrController);
    }