Пример #1
0
        public override IEnumerator Excute()
        {
            yield return(null);

            BattleEquipData removedEquip   = null;
            PlayerInfoView  playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(EquipData.Owner);

            if (playerInfoView.PlayerInfo.Equips.Count > 0 && playerInfoView.PlayerInfo.Equips.Count >= BattleMgr.MAX_EQUIP_COUNT)
            {
                removedEquip = playerInfoView.PlayerInfo.Equips[0];
                playerInfoView.PlayerInfo.Equips.RemoveAt(0);
            }
            playerInfoView.PlayerInfo.Equips.Add(EquipData);
            GameObject goEquip = null;

            if (playerInfoView.EquipIcons.ContainsKey(EquipData.EquipId))
            {
                goEquip = playerInfoView.EquipIcons[EquipData.EquipId];
            }
            if (goEquip == null)
            {
                goEquip = GameObject.Instantiate(playerInfoView.goEquipTemplete);
                playerInfoView.EquipIcons.Add(EquipData.EquipId, goEquip);
                goEquip.transform.parent     = playerInfoView.gridEquipGrid.transform;
                goEquip.transform.localScale = Vector3.one;
            }
            goEquip.SetActive(true);
            goEquip.name = EquipData.EquipId.ToString();
            UIUtility.SetEquipTips(goEquip, EquipData.EquipId);
            goEquip.transform.Find("Icon").GetComponent <UITexture>().Load(EquipData.Data.IconID);
            yield return(null);

            playerInfoView.gridEquipGrid.Reposition();
        }
Пример #2
0
        public override IEnumerator Excute()
        {
            UIBattleCard battleCard = BattleForm.GetUIBattleCard(CardData);

            if (battleCard == null)
            {
                yield return(null);
            }
            battleCard.UseCard();
            Vector3 cachePos = battleCard.cacheChildCardTrans.position;

            battleCard.transform.SetParent(BattleForm.UsedCardsGrid.transform, false);
            BattleForm.UsedCardsGrid.Reposition();
            BattleForm.MyCardsGrid.Reposition();

            battleCard.cacheChildCardTrans.position = cachePos;
            yield return(null);

            TweenPosition.Begin(battleCard.cacheChildCardTrans.gameObject, 0.5f, Vector3.zero, false);
            PlayerInfoView playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(CardData.Owner);

            playerInfoView.PlayerInfo.CemeteryCount++;
            //playerInfoView.PlayerInfo.AP -= battleCard.CardData.Data.Spending;
            yield return(new WaitForSeconds(0.5f));

            BattleForm.OppCardsGrid.Reposition();
            battleCard.RefreshDepth();
            yield return(null);
        }
Пример #3
0
 public void populatePlayerList()
 {
     for (int i = 0; i < GameManager.Instance.playerCount(); i++)
     {
         GameObject pi = Instantiate(PlayerInfoPrefab);
         pi.transform.SetParent(PlayerPanel.transform);
         PlayerInfoView infoView = pi.GetComponent <PlayerInfoView>();
         playerInfoSpots.Add(infoView);
         infoView.loadFromPlayer(GameManager.Instance.getPlayerByID(i));
     }
 }
Пример #4
0
        public override IEnumerator Excute()
        {
            PlayerInfoView playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(Player);

            //playerInfoView.PlayerInfo.AP = playerInfoView.PlayerInfo.MaxAP = playerInfoView.BindPlayerData.MaxAP;
            BattleForm.UpdateRoundCount(Game.BattleManager.RoundCount);
            if (Player.IsMe)
            {
                BattleForm.CanUseCard = true;
            }
            yield return(null);
        }
Пример #5
0
        public async Task <ActionResult <PlayerInfoView> > Get(int id)
        {
            var player = await _db.Players
                         .Include(x => x.Location)
                         .Include(x => x.QuestPlayers)
                         .ThenInclude(x => x.Quest)
                         .FirstOrDefaultAsync(x => x.Id == id);

            if (player == null)
            {
                return(NotFound());
            }
            var playerInfo = new PlayerInfoView
            {
                Player = new Player
                {
                    Id                    = player.Id,
                    Name                  = player.Name,
                    Description           = player.Description,
                    LocationId            = player.LocationId,
                    NumberOfPayedAccounts = player.NumberOfPayedAccounts
                },
                Location = new Location
                {
                    Description = player.Location.Description,
                    Id          = player.Location.Id,
                    Name        = player.Location.Name,
                },
                Quests = player.QuestPlayers.Select(x => x.Quest).Select(q => new Quest
                {
                    AmountToPrint    = q.AmountToPrint,
                    ArtisticTextLink = q.ArtisticTextLink,
                    Complexity       = q.Complexity,
                    Description      = q.Description,
                    Grade            = q.Grade,
                    Id = q.Id,
                    IsArtisticTextReady = q.IsArtisticTextReady,
                    Name = q.Name,
                    TechnicalDescriptionLink    = q.TechnicalDescriptionLink,
                    IsTechnicalDescriptionReady = q.IsTechnicalDescriptionReady,
                    IsPrinted = q.IsPrinted,
                }).ToList(),
            };

            return(new ObjectResult(playerInfo));
        }
Пример #6
0
        public override IEnumerator Excute()
        {
            PlayerInfoView playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(Player);
            Color          orginColor     = playerInfoView.lblMP.color;

            playerInfoView.lblMP.color = Color.green;
            yield return(null);

            TweenScale.Begin(playerInfoView.lblMP.gameObject, 0.15f, new Vector3(1.2f, 1.2f, 1.2f));
            yield return(new WaitForSeconds(0.15f));

            playerInfoView.PlayerInfo.MP -= SpentAp;
            TweenScale.Begin(playerInfoView.lblMP.gameObject, 0.15f, Vector3.one);
            yield return(new WaitForSeconds(0.15f));

            playerInfoView.lblMP.color = orginColor;
            yield return(null);
        }
Пример #7
0
    // Use this for initialization
    protected override void OnOpen()
    {
        myPlayerViews = transform.Find("BattleInfo/MeInfo").gameObject.AddComponent <PlayerInfoView>();
        myPlayerViews.InitData(Game.BattleManager.MyPlayer.Data);
        oppPlayerViews = transform.Find("BattleInfo/OppInfo").gameObject.AddComponent <PlayerInfoView>();
        oppPlayerViews.InitData(Game.BattleManager.OppPlayer.Data);
        //myPlayerViews.GetUIController();
        //oppPlayerViews.GetUIController();
        MovingPanel      = transform.Find("MovingPanel").GetComponent <UIPanel>();
        lblRoundCount    = transform.Find("FlowPanel/split/lblRoundCount").GetComponent <UILabel>();
        btnBattleSetting = transform.Find("FlowPanel/btnSetting").gameObject;
        UpdateInfo();
        monsterId = Game.BattleManager.MonsterId;
        Game.BattleManager.ReadyStart(this);
        UIEventListener.Get(transform.Find("FlowPanel/btnRoundEnd").gameObject).onClick = OnClick_RoundEnd;
        UIEventListener.Get(btnBattleSetting).onClick = Onclick_Setting;

        StartCoroutine(CoroutineUseCard());
    }
Пример #8
0
        public override IEnumerator Excute()
        {
            PlayerInfoView playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(Target);
            Color          orginColor     = playerInfoView.lblHP.color;

            playerInfoView.lblHP.color = Color.red;
            yield return(null);

            TweenScale.Begin(playerInfoView.lblHP.gameObject, 0.15f, new Vector3(1.2f, 1.2f, 1.2f));
            yield return(new WaitForSeconds(0.15f));

            playerInfoView.PlayerInfo.HP -= Damage;

            TweenScale.Begin(playerInfoView.lblHP.gameObject, 0.15f, Vector3.one);
            yield return(new WaitForSeconds(0.15f));

            playerInfoView.lblHP.color = orginColor;
            //yield return BattleForm.GetPlayerInfoViewByPlayer(Target).SetHpDamage(Damage);
        }
Пример #9
0
        public override IEnumerator Excute()
        {
            yield return(null);

            if (CardData.Owner == Game.BattleManager.MyPlayer)
            {
                BattleForm.CreateBattleCard(CardData, BattleForm.MyCardsGrid);
            }
            else
            {
                BattleForm.CreateBattleCard(CardData, BattleForm.OppCardsGrid);
            }
            PlayerInfoView playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(CardData.Owner);

            //playerInfoView.PlayerInfo.CardCount--;
            if (playerInfoView.PlayerInfo.CardCount <= 0)
            {
                playerInfoView.PlayerInfo.CardCount = playerInfoView.BindPlayerData.CurrentCardList.Count;
            }
            yield return(new WaitForSeconds(0.5f));
        }
Пример #10
0
        public override IEnumerator Excute()
        {
            //yield return BattleForm.GetPlayerInfoViewByPlayer(Target).SetHpRecover(RecoverdHp);
            PlayerInfoView playerInfoView = BattleForm.GetPlayerInfoViewByPlayer(Target);
            Color          orginColor     = playerInfoView.lblHP.color;

            playerInfoView.lblHP.color = Color.green;
            yield return(null);

            TweenScale.Begin(playerInfoView.lblHP.gameObject, 0.15f, new Vector3(1.2f, 1.2f, 1.2f));
            yield return(new WaitForSeconds(0.15f));

            playerInfoView.PlayerInfo.HP += RecoverdHp;
            if (playerInfoView.PlayerInfo.HP >= playerInfoView.PlayerInfo.MaxHP)
            {
                playerInfoView.PlayerInfo.HP = playerInfoView.PlayerInfo.MaxHP;
            }
            TweenScale.Begin(playerInfoView.lblHP.gameObject, 0.15f, Vector3.one);
            yield return(new WaitForSeconds(0.15f));

            playerInfoView.lblHP.color = orginColor;
        }
Пример #11
0
        private void PlayerMenu(int page)
        {
            PlayerInfoView view = new PlayerInfoView(page, this);

            view.ShowDialog();
        }
Пример #12
0
        public App()
        {
            InitializeComponent();

            MainPage = new PlayerInfoView();
        }
Пример #13
0
 void Start()
 {
     playerAnimator = this.GetComponent <PlayerAnim>();
     playerInfoView = GameObject.Find("CharacterInfoView").GetComponent <PlayerInfoView>();
     scoreUI        = GameObject.Find("ScoreManager").GetComponent <Score>();
 }