Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - windvn

Pages: [1]
1
NGUI 3 Support / Can't click in NGui Button created by prefab
« on: September 25, 2014, 02:28:51 AM »
My Problem is:
 I create ngui button by prefab .Then I add button to my horizontal scroll view

 foreach (var map in player.Mapdata)
        {
            //var mapx=Instantiate(mapprefab, new Vector3(-100, 0, 0), Quaternion.Euler(0, 0, 0)) as GameObject;
            var mapx = NGUITools.AddChild(ScrollViewWrapMap.gameObject, mapprefab);
            if (mapx != null)
            {
                var mapc = mapx.GetComponent<MapItem>();
                mapc.SetData(map);
                mapx.transform.localPosition = new Vector3(pointStart + (index++) * 200.0f, 0, 0);
                mapx.transform.localScale = Vector3.one;
                mapx.transform.localRotation = Quaternion.identity;
                NGUITools.SetActive(mapx, true);
               
            }
        }

My map button is display in scrollview an my horizontal scorll view is work But I can't click in my button.

When I click forward button in Unity Editor to change depth then i can click button.

But when I change depth by my code then my button still can't click.

Pages: [1]