Пример #1
0
    private IEnumerator ProcessAllRefugees()
    {
        while (true)
        {
            if (queue.Count == 0)
            {
                yield return(new WaitForTicks(1));
            }
            else
            {
                Refugee current = queue.Dequeue();
                current.SetNewDestination(lineStartPos);
                yield return(new WaitForTicks(timeToProcess));

                current.SetNewDestination(finishedProcessingPos);
                HousingManager.GetInstance().GetBestHouse().AddOccupant(current);
            }
        }
    }
Пример #2
0
 public void AddRefugee(Refugee newRefugee)
 {
     queue.Enqueue(newRefugee);
     newRefugee.SetNewDestination(beforeProcessingPos + new Vector3(Random.Range(-10, 10), 0, Random.Range(-10, 10)));
 }