Пример #1
0
    /// <summary>
    /// Instantiates a customer in delayed times
    /// </summary>
    /// <returns></returns>
    private IEnumerator SpawnCycle()
    {
        foreach (float time in spawnTime)
        {
            // fixed arrival time
            yield return(new WaitForSeconds(time));

            // line overflow waiting loop
            if (waitingArea.IsLineFull())
            {
                yield return(waitingArea.OverflowLine());
            }

            NewCustomer();
        }
    }