public LoadingPopup(LoadObjectsManager loadObjectsManager, UIManager uiManager, ScenesManager scenesManager) { _loadObjectsManager = loadObjectsManager; _uiManager = uiManager; _uiManager.AddPopup(this); _scenesManager = scenesManager; var resourceObject = _loadObjectsManager.GetObjectByPath(Constants.PATH_TO_UI_PREFABS + "Popups/LoadingPopup").GetAwaiter(); resourceObject.OnCompleted(() => { SelfPage = MonoBehaviour.Instantiate(resourceObject.GetResult() as GameObject); SelfPage.transform.SetParent(_uiManager.Canvas.transform, false); _pageComponent = SelfPage.GetComponent <LoadingPopupComponent>(); OnPopupWasInited(); }); }
public SettingsPopup(UIManager uIManager, LoadObjectsManager loadObjectsManager, GameStateManager gameStateManager) { _uIManager = uIManager; _loadObjectsManager = loadObjectsManager; _gameStateManager = gameStateManager; _uIManager.AddPopup(this); _awaiter = _loadObjectsManager.GetObjectByPath(Constants.PATH_TO_UI_PREFABS + "Popups/SettingsPopup").GetAwaiter(); _awaiter.OnCompleted(() => { SelfPage = MonoBehaviour.Instantiate(_awaiter.GetResult() as GameObject); SelfPage.transform.SetParent(_uIManager.Canvas.transform, false); _pageComponent = SelfPage.GetComponent <SettingsPopupComponent>(); OnPopupWasInited(); }); }