protected override void Init() { attackSideWidget = AddSide(true); deffenceSideWidget = AddSide(false); Table.Reposition(); }
UIBattleSideWidget AddSide(bool isAttack) { GameObject w_go = (GameObject)NGUITools.AddChild(Table.gameObject, UIBattleSidePrefab); w_go.name = (isAttack ? "attack side" : "deffence side"); UIBattleSideWidget w = w_go.GetComponent <UIBattleSideWidget>(); w.parentPanel = this; w.isAttack = isAttack; return(w); }