예제 #1
0
    public void EnterElevator(Elevator el)
    {

        if (floorNo != (int)el.GetFloor() || !el.IsEnterableState())
            return;

        float delay=0;

        int idx = 0;
        while(idx< listPassinger.Count)
        {

            if (!el.IsEnterableState())
                break;

            if (el.AddPassinger(listPassinger[idx]))
            {
                listPassinger.RemoveAt(idx);
                delay += Random.Range(0.6f, 1.0f);
            }
            else
                ++idx;
            
        }


        textPassinger.text = listPassinger.Count.ToString();

       
        LandingElevators.Add(el);
        return;

    }