public IEnumerator AttendAppointment(NPC actor) { //make the npc stop listen to the movement of the next npc it wants to talk to and start listening to the next if (conversationPartner != null) { conversationPartner.OnPositionChange -= actor.UpdateDistance; } Appointment next = actor.appointments.GetNext(); if (next != null) { if (next.conversation != null) { actor.appointments.GetNext().conversationPartner.OnPositionChange += actor.UpdateDistance; } } if (place != null) { yield return(actor.StartCoroutine(actor.GoTo(place()))); } if (conversation != null) { yield return(actor.StartCoroutine(actor.TalkTo(conversationPartner, conversation))); } }