コード例 #1
0
    IEnumerator ReachTillCycleCoroutine()
    {
        distanceSlider.maxValue = currentWait;
        distanceSlider.value    = 1;
        while (pursuitOn)
        {
            yield return(new WaitForSeconds(1));

            distanceSlider.value++;

            if (distanceSlider.value >= currentWait)
            {
                pursuitOn = false;
            }
        }
        Debug.Log("Caught up to cycle");
        obstacleSpawner.BlockRow(brokenCycleSpawnPoint);
        brokenCycleBehaviour = Instantiate(brokenCycle, brokenCycleSpawnPoint.position, Quaternion.identity).GetComponent <BrokenCycleBehaviour>();
        yield return(null);
    }