Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI.Extensions;
- public class instantiateChilds : MonoBehaviour {
- public GameObject leprefab;
- public GameObject lecontainer;
- public HorizontalScrollSnap snapper;
- public UI_InfiniteScroll infiScroll;
- GameObject[] s;
- bool once = true;
- // Use this for initialization
- public void AddnewImage () {
- GameObject go = Instantiate (leprefab);
- snapper.AddChild (go);
- GameObject go2 = Instantiate (leprefab);
- snapper.AddChild (go2);
- GameObject go3 = Instantiate (leprefab);
- snapper.AddChild (go3);
- }
- public void RemoveChildrens(){
- snapper.RemoveAllChildren(out s);
- for(int i = 0; i<s.Length; i++){
- Destroy (s[i].gameObject);
- }
- infiScroll.DeleteParameters ();
- }
- public void Runinit(){
- infiScroll.Init ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment