Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class UPStand : MonoBehaviour
- {
- public GameObject SaleButtonPrefab;
- public GameObject ParentButton;
- public int
- void Start()
- {
- //To loop all the list
- for(int i = 0; i < 3; i++)
- {
- //Instantiate the button prefab and make a parent
- GameObject nu = Instantiate(SaleButtonPrefab) as GameObject;
- nu.transform.SetParent(ParentButton.transform, false);
- //To set the position and function
- nu.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, (i*-289.5f) );
- }
- }
- }
Add Comment
Please, Sign In to add comment