public PopupDialogController CreatePopupDialog(string _textTitle, string _textMessage, string _errorCode, string _textSubmitButton, string _textCancleButton, System.Action _onSubmit, System.Action _onCanel) { if (myCanvas.worldCamera == null && CoreGameManager.instance.currentSceneManager != null) { myCanvas.worldCamera = CoreGameManager.instance.currentSceneManager.cameraForConsumableScreen.mainCamera; } else { myCanvas.worldCamera = Camera.main; } myCanvasGroup.alpha = 1f; myCanvasGroup.blocksRaycasts = true; PopupDialogController _tmpPopup = LeanPool.Spawn(popupDialogPrefab.transform, Vector3.zero, Quaternion.identity, pool.transform).GetComponent <PopupDialogController>(); _tmpPopup.Init(_textTitle, _textMessage, _errorCode, _textSubmitButton, _textCancleButton, _onSubmit, _onCanel, () => { RemovePopupActive(_tmpPopup); }); MyAudioManager.instance.PlaySfx(PopupManager.Instance.myInfoAudio.sfx_Popup); AddPopupActive(_tmpPopup); return(_tmpPopup); }