Author Topic: Strage UIGrid / UIDraggablePanel behave [SOLVED]  (Read 2783 times)

EdLan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Strage UIGrid / UIDraggablePanel behave [SOLVED]
« on: May 11, 2013, 05:33:29 PM »
Hi @all

Currently I have a strange behave, when I try to add prefabs with a UIDrag Panel Content Object attached per script to a UIGrid. Here is my code to add a prefab to the grid:

  1.                         GameObject item = NGUITools.AddChild(ListGrid.gameObject, prefabEntry);
  2.                        
  3.                         item.GetComponent<UIDragPanelContents>().draggablePanel = DraggablePanel;
  4.                        
  5.                         UILabel label = item.transform.FindChild("Label").GetComponent<UILabel>();
  6.  
  7.  

When I run this code on runtime, then the items of the grid are not movable. They don't react on mouse events when I try to scroll the grid content up and down.

When I add the same prefab(s) to the grid in the Editor, then it works without any problem. Has anyone an idea what I forgot? Currently I use NGUI 2.6.1e

Cheers, EdLan
« Last Edit: May 11, 2013, 05:48:58 PM by EdLan »

EdLan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Strage UIGrid / UIDraggablePanel behave
« Reply #1 on: May 11, 2013, 05:48:12 PM »
Ok... Got it! The layer was not set to the NGUI layer...  ::)