Hello I am new-be of NGUI
I try to create dynamic button.
this is my code
-------------------------------------------
using UnityEngine;
using System.Collections;
[AddComponentMenu("NGUI/Examples/Test Dynamic Button")]
public class TestDynamicButton : MonoBehaviour {
public GameObject btn1;//<<<my prefab button from default button
// Use this for initialization
void Start ()
{
for (int i = 0; i < 20; i++)
{
GameObject parent = GameObject.Find("UIGrid");//<<<< my UIPanel > UIGrid with Scroll Bar
GameObject child = NGUITools.AddChild(parent,btn1);
//GameObject button = child.GetComponentInChildren();
child
.transform.localPosition = new Vector3
( 0+i
*250 ,
0 );//it is horizontal }
GameObject.Find("Panel-ButtonList").GetComponent<UIDraggablePanel>().ResetPosition(); //I see you say after add mush reset
}
// Update is called once per frame
void Update () {
}
}
-------------------------------------------------------------------------
After run It was create and can slide by Scroll Bar
But It don't active when OnHover or OnPress

( It seem like texture not button )
Can you help me Thx.
