Hello Guest

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 - Dasc

Pages: [1]
1
Have a similar issue with tk2dUILayoutContainerSizer, comes out with stack overflow!

What I've done:-
// Step 1 - Create blank scene
// Step 2 - Drag in "BasicButton" (with layout)
// Step 3 - Create empty game object and add tk2dUILayoutContainerSizer
// Step 4 - create a script to instantiate multiple "BasicButton" from the scene, then adding it to the tk2dUILayoutContainerSizer
// Script
public tk2dUILayout prefabItem;

void Start(){
  tk2dUILayout myLayout = Instantiate<tk2dUILayout>(prefabItem);
  tk2dUILayoutContainerSizer sizer = this.GetComponent<tk2dUILayoutContainerSizer>();

  foreach (tk2dUILayoutItem item in myLayout.layoutItems) {
    sizer.AddLayout(myLayout, item);  <---- produces stack overflow
  }
}

Pages: [1]