public override GameObject createContent() // создание контента, на основе радиобатона, заполнение заготовленых айтемов { var goldFromCrystalExchange = windowController.getMarketExchange(); GameObject prefab = getResources().goldBuyItemPrefab; GameObject content = new GameObject("Content"); GameObject radioButtons = new GameObject("RadioButtons"); radioButtons.transform.parent = content.transform; RadioButtons rb = radioButtons.AddComponent <RadioButtons>(); rb.shift = new Vector2(0.0f, -2.09f); int len = goldFromCrystalExchange.Length; rb.init(prefab, len, RadioButtons.TypeDisposition.VERTICAL, 1.0f, true); isHaveBonuses = false; for (int i = 0; i < goldFromCrystalExchange.Length; i++) { if (goldFromCrystalExchange[i].Free > 0) { isHaveBonuses = true; } } fillGoldItems(rb); rb.subscribeOnRadioBtnSelected(onBuyGoldClick); return(content); }
public override GameObject createContent() // создание контента при условии полученых данных от сервера { var crystalItems = windowController.getCrystalItems(); GameObject prefab = getResources().crystalBuyItemPrefab; var market = windowController.getMarketEvent(); GameObject content = new GameObject("Content"); GameObject radioButtons = new GameObject("RadioButtons"); radioButtons.transform.parent = content.transform; RadioButtons rb = radioButtons.AddComponent <RadioButtons>(); rb.shift = new Vector2(0.0f, -1.67f); int len = crystalItems.Length; rb.init(prefab, len, RadioButtons.TypeDisposition.VERTICAL, 0.8f, true); rb.subscribeOnRadioBtnSelected(onBuyCrystalClick); fillCrystalItems(rb); // заполнение return(content); }