示例#1
0
    public IEnumerator AddFightingText(int counter, string Lastwords)
    {
        bool switcher = false;


        while (counter > 60)
        {
            if (!switcher)
            {
                totalHpEnemy      -= 60;
                BattleLOGtxt.text += "\nPlayer is Attackting, Enemy Health Minus = " + totalHpEnemy.ToString();
                Total_CalcaulationEnemy_Hp.text = totalHpEnemy.ToString();
                switcher = true;
            }
            else
            {
                totalHpPlayer              -= 60;
                BattleLOGtxt.text          += "\nEnemy is Attackting, Player Health Minus = " + totalHpPlayer.ToString();
                Total_Calcaulation_txt.text = totalHpPlayer.ToString();
                switcher = false;
            }
            yield return(new WaitForSeconds(2));

            counter -= 60;
        }
        OkPanel.SetActive(true);

        BattleLOGtxt.text += "\n" + Lastwords;
    }
示例#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);
    }