public void SetDependecies(GameObject popupRewardEvent, GameObject btn) { _popupReward = popupRewardEvent; _closePanel = _popupReward.GetComponentsInChildren <Transform>().SearchChild("ClosePanelPlayer").gameObject; _btnContinue = btn; _buttonContinue = _btnContinue.GetComponent <Button>(); _poolTokensReward = _objectStorage.GetPollObjects(ObjectTypeEnum.PrefabToken, 3); var art = _poolTokensReward[0].GetComponentsInChildren <Transform>().SearchChild("SpriteArt"); var rectToken = art.GetComponent <RectTransform>(); foreach (var objToken in _poolTokensReward) { _configurateManager.ConfigurateByParent(objToken, _popupReward, false); objToken.GetComponent <RectTransform>().SetOffset(0, 0, 0, 0); var artSprite = objToken.GetComponentsInChildren <Transform>().SearchChild("SpriteArt"); _configurateManager.ConfigurateSprite(artSprite.gameObject, rectToken); } }
public void SetDependecies(GameObject panelPlayes) { _panelPlayers = panelPlayes; //---------------------------- _poolIconToken = _objectStorage.GetPollObjects(ObjectTypeEnum.PrefabIconToken, 12); var art = _poolIconToken[0].GetComponent <Transform>(); var refRect = art.GetComponent <RectTransform>(); var count = 0; foreach (var icon in _poolIconToken) { _configurateManager.ConfigurateByParent(icon, _panelPlayers, false); var rectIcon = icon.GetComponent <RectTransform>(); rectIcon.SetOffset(0, 0, 0, 0); rectIcon.OffsetAnchorY(-0.0825f * count); var artSprite = icon.GetComponent <SpriteRenderer>(); _configurateManager.ConfigurateSprite(artSprite.gameObject, refRect); ++count; } }