public void LoadEnteredTraveler(TravelerTimerData timerData) { TravelerTimer timer = new TravelerTimer(timerData); timer.OnUsingStructure(); curUsingQueue.Enqueue(timer); StartCoroutine(timer.UsingStructure(duration)); }
public TravelerTimer(TravelerTimerData timerData) { switch (timerData.travelerType) { case ActorType.Traveler: traveler = GameManager.Instance.travelersEnabled[timerData.travelerIndex].GetComponent <Traveler>(); break; case ActorType.Adventurer: traveler = GameManager.Instance.adventurersEnabled[timerData.travelerIndex].GetComponent <Adventurer>(); break; case ActorType.SpecialAdventurer: traveler = GameManager.Instance.specialAdventurers[timerData.travelerIndex].GetComponent <SpecialAdventurer>(); break; } OnUsingStructure = traveler.OnUsingStructure; OnExitStructure = traveler.OnExitStructure; Tick = new WaitForSeconds(1.0f); }
public void LoadWaitingTraveler(TravelerTimerData timerData) { curWaitingQueue.Enqueue(new TravelerTimer(timerData)); }