public void LoadEnteredTraveler(TravelerTimerData timerData) { TravelerTimer timer = new TravelerTimer(timerData); timer.OnUsingStructure(); curUsingQueue.Enqueue(timer); StartCoroutine(timer.UsingStructure(duration)); }
public void ExitTraveler() // Timer에서 시간지나면 자동호출됨. { //UsingQueue 에서 한명 빠질때 . TravelerTimer t = curUsingQueue.Dequeue(); Debug.Log(names + "-----------------------Current Using Queue Size = " + curUsingQueue.Count + "/" + capacity); EnterTraveler(); }
public void EnterTraveler() { if (curWaitingQueue.Count > 0) { TravelerTimer t = curWaitingQueue.Dequeue(); t.OnUsingStructure(); curUsingQueue.Enqueue(t); StartCoroutine(t.UsingStructure(duration)); } Debug.Log(names + "-----------------------Current Using Queue Size = " + curUsingQueue.Count + "/" + capacity); }
public void AddWaitTraveler(Traveler t) // 첫번째로 호출. { TravelerTimer timer = new TravelerTimer(t, t.OnUsingStructure, t.OnExitStructure); curWaitingQueue.Enqueue(timer); if (curUsingQueue.Count < capacity) // 사용가능한 자리가 있을때 { EnterTraveler(); } else { //대기 처리 } }