public bool Close(string dialogID) { KeyValuePair <GameObject, string> dialog = _dialogs.FirstOrDefault(d => d.Value == dialogID); if (dialog.Equals(default(KeyValuePair <GameObject, string>))) { return(false); } DialogView view = dialog.Key.GetComponent <DialogView>(); if (view != null) { view.OnClose(); } _dialogs.Remove(dialog.Key); GameObject.Destroy(dialog.Key); gameObject.SetActive(_dialogs.Count > 0); return(true); }
public OpenDialogEventArgs(string dialogID, GameObject dialogObject) { DialogID = dialogID; DialogObject = dialogObject; ViewComponent = DialogObject.GetComponent <DialogView>(); }