public void CreateElementsPrize(OnFinishCallback onFinish = null) { prizeType = GameManager.Instance.currPrize; // Obtener nombre de los modelos a cargar DataPrize data = GameManager.Instance.GetDataPrize(prizeType); matCoin.SetFloat("Vector1_9AB0C6D0", 1f); foreach (string fileName in data.nameFile) { // Cargar modelos desde resources GameObject p = Instantiate(Resources.Load <GameObject>(pathResources + fileName)); p.name = data.namePrize; if (fileName != "Coin") { currPrizeRotate = p; p.transform.SetParent(this.transform); } else { p.transform.SetParent(posCoin); _coin = p; } p.transform.localPosition = Vector3.zero; p.transform.localScale = new Vector3(scale, scale, scale); } if (onFinish != null) { onFinish(); } }
public void SetInfo(DataPrize dp) { namePrize.text = dp.namePrize; imagePrize.overrideSprite = dp.iconPrize; prizeType = dp.prizeType; RappiMainMenu rm = FindObjectOfType <RappiMainMenu>(); button.onClick.AddListener(() => { rm.OnSelectPrize(this); rm.SetActivePanelListPrize(false); }); }