Beispiel #1
0
    IEnumerator WaitAndRest()
    {
        int t = _loading.CallInLoadingBar(0);

        yield return(new WaitForSeconds(t));

        ConfirmRest();
    }
    IEnumerator StartRebirth()
    {
        int t = _loadingBar.CallInLoadingBar(60);

        yield return(new WaitForSeconds(t));

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
    IEnumerator StartLoading(int costTime)
    {
        int t = _loadingBar.CallInLoadingBar(costTime);

        yield return(new WaitForSeconds(t));

        GoToMap();
    }
Beispiel #4
0
    public void Prepare()
    {
        int    index     = int.Parse(plantingTip.gameObject.name);
        int    plantType = GameData._playerData.Farms [index].plantType;;
        Plants p         = LoadTxt.GetPlant(plantType);

        foreach (int key in p.plantReq.Keys)
        {
            if (_gameData.CountInHome(key) < p.plantReq[key])
            {
                return;
            }
        }

        int t = _loading.CallInLoadingBar(60);

        StartCoroutine(GetPrepared(p, index, t));
    }
    IEnumerator WaitAndBuildRoom(Building b)
    {
        int t = _loadingBar.CallInLoadingBar(b.timeCost * 60);

        yield return(new WaitForSeconds(t));

        BuildRoom(b);
    }