private void SetCurrentState(IDialogState state) { if (_openedDialogs.Count == 0) { return; } var current = _openedDialogs.Last(); current.Context.SetState(state); }
private DialogEntity <IDialogState> Create(DialogType type, IDialogState state) { var name = type.GetPath(); var dialog = Resources.Load <BaseDialogContext <IDialogState> >(name); var go = UnityEngine.Object.Instantiate(dialog, _canvas.transform); var entity = new DialogEntity <IDialogState> { Type = type, Context = go }; go.Open(state); return(entity); }
public void Open(DialogType type, IDialogState state = null) { var entity = Create(type, state); _openedDialogs.Add(entity); }