public MenuPage(UIManager uiManager, LoadObjectsManager loadObjectsManager, ScenesManager scenesManager, GameStateManager gameStateManager, PlayerDataManager dataManager, SoundSystem soundSystem) { _uiManager = uiManager; _loadObjectsManager = loadObjectsManager; _scenesManager = scenesManager; _gameStateManager = gameStateManager; _dataManager = dataManager; _soundSystem = soundSystem; _uiManager.AddPage(this); _awaiter = _loadObjectsManager.GetObjectByPath(Constants.PATH_TO_UI_PREFABS + "MenuPage").GetAwaiter(); _awaiter.OnCompleted(() => { SelfPage = MonoBehaviour.Instantiate(_awaiter.GetResult() as GameObject); SelfPage.transform.SetParent(_uiManager.Canvas.transform, false); _pageComponent = SelfPage.GetComponent <MenuPageComponent>(); }); }
public void InitShop() { var _shopData = DataShopUtils.GetDataShopRecords().Select(r => new ShopItemData() { id = r.Id, reapeatType = r.RepeatType, shopPrice = r.Price, shopSprite = r.ShopSprite, shopTitle = r.Title }).ToList(); _shopList = new List <RegularShopItem>(); var resourceObject = _loadObjectsManager.GetObjectByPath(Constants.PATH_TO_UI_PREFABS + "Shop/" + "Shop_Item").GetAwaiter(); resourceObject.OnCompleted(() => { _shopPrefab = resourceObject.GetResult() as GameObject; for (int i = 0; i < _shopData.Count; i++) { RegularShopItem item = new RegularShopItem(_parent, _shopPrefab, _shopData[i]); item.CreateShopItem(); _shopList.Add(item); } }); }
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(); }); }