コード例 #1
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);
    }