using UnityEngine;
using System.Collections;
public class HierarchyTest : MonoBehaviour {
public GameObject Grid;
public GameObject Prefab;
public GameObject DragablePanel;
void OnClick()
{
GameObject _go = NGUITools.AddChild(Grid,Prefab);
_go.GetComponentInChildren<UILabel>().text = Random.Range(0,100).ToString();
_go.name = Random.Range(0,100).ToString();
Grid.GetComponent<UIGrid>().repositionNow = true;
DragablePanel.GetComponent<UIDraggablePanel>().ResetPosition();
}
}