コード例 #1
0
 public void StartBattle()
 {
     if (totalHpPlayer >= totalHpEnemy)
     {
         StartCoroutine(AddFightingText(totalHpEnemy, "Player Won"));
         targetpos.GetComponent <VillageInfo>().Level_info._isBattleWin = true;
     }
     else
     {
         StartCoroutine(AddFightingText(totalHpPlayer, "Enemy Won"));
     }
     BattlePanel.SetActive(false);
 }
コード例 #2
0
    IEnumerator moveto(Vector2 target)
    {
        float Step = speed * Time.deltaTime;

        while (Vector2.Distance(Player.transform.position, target) > 0.2f)
        {
            Player.transform.position = Vector2.MoveTowards(Player.transform.position, target, Step);
            CurrentDay           = GetDay.EnterDayCode(Mathf.RoundToInt(Vector2.Distance(Player.transform.position, target)));
            currentTimezone.text = CurrentDay;
            yield return(null);
        }

        _buttonDown = false;
        for (int i = 0; i < BattleSlider.Count; i++)
        {
            BattleSlider[i].value         = 0;
            BattleSliderUpperText[i].text = "0";
        }
        BattleLOGtxt.text                = "";
        Total_Calcaulation_txt.text      = "0";
        Total_ATk_Calucation_txt.text    = "0";
        Total_CalcaulationEnemy_Hp.text  = "200";
        Total_CalcaulationEnemy_ATK.text = "100";
        totalHpEnemy   = 200;
        totalATKEnemy  = 100;
        totalHpPlayer  = 0;
        totalATKPlayer = 0;


        if (targetpos.GetComponent <VillageInfo>().Level_info._isBattleWin)
        {
            OpenCity();
        }
        else
        {
            OkPanel.SetActive(false);
            BattlePanel.SetActive(true);
            MainMenuPanel.SetActive(true);
            BattleMenuPanel.SetActive(true);
            UpgradeMenuPanel.SetActive(false);
        }


        updateDbEnd(-temp_EnduranceRequiredValue);
    }
コード例 #3
0
ファイル: UIHeroSlot.cs プロジェクト: TimonYoon/Dev
    //void OnChangedHeroParam(PropertyInfo property)
    //{
    //    return;
    //}

    /// <summary> 배치된 지역 보여주기 </summary>
    public void ShowDeployedPlace()
    {
        if (state == HeroSlotState.Territory && string.IsNullOrEmpty(heroData.placeID) == false)
        {
            string placeName = heroData.placeID;
            if (GameDataManager.productionLineBaseDataDic.ContainsKey(heroData.placeID))
            {
                placeName = GameDataManager.productionLineBaseDataDic[heroData.placeID].name;
            }
            else if (GameDataManager.placeBaseDataDic.ContainsKey(heroData.placeID))
            {
                placeName = GameDataManager.placeBaseDataDic[heroData.placeID].name;
            }


            Text text = BattlePanel.GetComponentInChildren <Text>();
            text.text = placeName;
            BattlePanel.SetActive(true);
        }
        else if (state == HeroSlotState.Battle && HeroManager.heroDataDic[id].heroType == HeroData.HeroType.Battle)
        {
            if (heroData != null && string.IsNullOrEmpty(heroData.battleGroupID) == false)
            {
                //HeroData data = HeroManager.heroDataDic[id];
                string dungeonName = GameDataManager.dungeonBaseDataDic[Battle.battleGroupList.Find(x => x.battleType == heroData.battleGroupID).dungeonID].dungeonName;
                Text   text        = BattlePanel.GetComponentInChildren <Text>();
                text.text = dungeonName;
                BattlePanel.SetActive(true);
            }
            else
            {
                BattlePanel.SetActive(false);
            }
        }
        else if (state == HeroSlotState.Training)
        {
            if (string.IsNullOrEmpty(heroData.placeID) == false)
            {
                string placeName = heroData.placeID;
                if (GameDataManager.productionLineBaseDataDic.ContainsKey(heroData.placeID))
                {
                    placeName = GameDataManager.productionLineBaseDataDic[heroData.placeID].name;
                }
                else if (GameDataManager.placeBaseDataDic.ContainsKey(heroData.placeID))
                {
                    placeName = GameDataManager.placeBaseDataDic[heroData.placeID].name;
                }


                Text text = BattlePanel.GetComponentInChildren <Text>();
                text.text = placeName;
                BattlePanel.SetActive(true);
            }
            else if (HeroManager.heroDataDic[id].heroType == HeroData.HeroType.Battle)
            {
                if (heroData != null && string.IsNullOrEmpty(heroData.battleGroupID) == false)
                {
                    string dungeonName = GameDataManager.dungeonBaseDataDic[Battle.battleGroupList.Find(x => x.battleType == heroData.battleGroupID).dungeonID].dungeonName;
                    Text   text        = BattlePanel.GetComponentInChildren <Text>();
                    text.text = dungeonName;
                    BattlePanel.SetActive(true);
                }
                else
                {
                    BattlePanel.SetActive(false);
                }
            }
            else
            {
                BattlePanel.SetActive(false);
            }
        }
        else
        {
            BattlePanel.SetActive(false);
        }
    }