void CreateListSMSRecharge() { List <RechargeModel> smsRecharge = GameManager.Instance.ListRechargeModel.FindAll(m => m.Type == "sms"); foreach (RechargeModel model in smsRecharge) { SMSRechargeView.Create(model, tableSMS.gameObject.transform); } tableSMS.Reposition(); StartCoroutine(Reposition()); }
public static SMSRechargeView Create(RechargeModel model, Transform parent) { GameObject obj = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/HeaderMenu/Recharge/SMSRechargeView")); obj.name = "sms " + model.Value; obj.transform.parent = parent; obj.transform.localPosition = new Vector3(0f, 0f, -1f); obj.transform.localScale = Vector3.one; SMSRechargeView sms = obj.GetComponent <SMSRechargeView>(); sms.SetData(model); return(sms); }