public void SetWorker(TaskWorkerAI worker)
        {
            if (currentWorker != null && worker != currentWorker)
            {
                return;
            }

            currentWorker             = worker;
            currentWorker.worker.Desk = this;

            TaskSystem.Task StartWorking = new TaskSystem.Task
            {
                moveToPosition = new TaskSystem.Task.MoveTo(chair.position, 0, () =>
                {
                    currentWorker         = worker;
                    worker.currentThought = DialogueSys.GetWorkPhrase();
                }),
                executeActionRecurring = () =>
                {
                    Clicked();
                    if (Time.frameCount % 300 == 1)
                    {
                        worker.currentThought = DialogueSys.GetRandomPhrase();
                    }
                }
            };

            worker.taskManager.tasks.Enqueue(StartWorking);
        }
Example #2
0
 public IEnumerator Sing(TaskSystem.Task task)
 {
     yield return(task);
 }