I'm new to NGUI and having a bit of trouble changing maxPerLine. I've got a UIGrid (CardGrid06) being populated with either 6 or 12 cards using PlayMaker.
Right now I have a button that deals 6 and a button that deals 12. If it's 6 then I want 3 lines (default), if it's 12 then I want change it to 4 lines, but I can't get it to change.
My code on the 12 button is this:
using UnityEngine;
using System.Collections;
public class ButtonCards12 : MonoBehaviour {
// Use this for initialization
void Awake () {
}
void onClick () {
GameObject.Find ("CardGrid06").GetComponent<UIGrid>().maxPerLine = 4;
}
}