private void UpdateUI() { if (queue) { if (queue.GetQueueLength() > 0) { ActionText.text = queue.queue[0].need.GetAction(); } else { ActionText.text = "Nothing in queue"; } if (queue.actualState == BusyType.ACTING) { ActionType.text = "Interacting " + queue.queue[0].need.GetExecutionTime().ToString(); } else { ActionType.text = "Travelling"; } } else { ActionText.text = "Click on someone"; ActionType.text = ""; } }
private void Update() { if (queuer.GetQueueLength() >= 2) { return; } List <INeed> needs = entity.GetNeeds(); foreach (Objects.IObject obj in entity.GetOwned()) { needs.AddRange(obj.GetComponents <INeed>()); } INeed first = needs.OrderByDescending(e => e.GetPriority()).FirstOrDefault(); queuer.AddElementToQueue(new UniversalQueueMember(first)); }