/// <summary> /// Opens the dialog. /// </summary> /// <param name="closeMethod">Close method used by this dialog.</param> public virtual void OpenDialog(CloseDialogMethod closeMethod){ // Set the closing method this.closeDialogMethod = closeMethod; this.transform.localScale = Vector3.one; this.raycaster.enabled = true; }
/// <summary> /// Closes the dialog. /// </summary> /// <param name="closeAction">Close action used to close this Dialog.</param> public void CloseDialog(DialogCloseAction closeAction){ // If a special close method was used if (this.closeDialogMethod != null) { CloseDialogMethod tmp = this.closeDialogMethod; this.closeDialogMethod = null; tmp(closeAction); } this.transform.localScale = Vector3.zero; this.raycaster.enabled = false; // If we where the current popup, hide the Cache if (UIScreenManager.Instance != null && UIScreenManager.Instance.CurrentDialog == this) { UIScreenManager.Instance.HideDialog(); UIScreenManager.Instance.CurrentDialog = null; } }