private void StartDialogInternal(DialogInstance instance) { CurrentDialog = instance; CurrentDialog.Init(); CurrentDialog.OnDialogStart.Invoke(); foreach (var actor in CurrentDialog.Actors.Where(a => a.Type == DialogInstance.ActorType.Dynamic)) { var go = GameObject.FindGameObjectWithTag(actor.Tag); if (go != null) { actor.Actor = go.GetComponentInChildren <DialogActor>() ?? go.GetComponentInParent <DialogActor>(); } if (!actor.Actor) { Debug.LogWarning(string.Format("Missing actor '{0}' for dialog '{1}'!", actor.Name, CurrentDialog.Dialog.name), CurrentDialog); } } SwitchState(CurrentDialog.Dialog.FirstState); }
IEnumerator CoStartDialogDelayed(DialogInstance instance) { yield return(new WaitForSecondsRealtime(Delay)); StartDialogInternal(instance); }