protected override void OnInititalize() { option.ruleGetter = GetRule; option.axisType = root is HorizontalLayoutGroup ? GridLayoutGroup.Axis.Horizontal : GridLayoutGroup.Axis.Vertical; option.pool = BridgeUI.Utility.CreatePool(transform, out itemPool); creater = new LineTreeItemCreater(0, root.transform, option); }
protected override void OnUnInitialize() { creater.Clear(); creater = null; if (itemPool != null) { GameObject.Destroy(itemPool); } }
public void InitTreeSelecter(int deepth, TreeNode node, LineTreeOption option) { this.node = node; var ruleget = option.ruleGetter; this.rule = ruleget(deepth); if (node.childern != null && node.childern.Length > 0) { InitContent(option.axisType); creater = new LineTreeItemCreater(deepth, childContent, option); var items = creater.CreateTreeSelectItems(node.childern.ToArray()); foreach (var item in items) { item.onSelection = OnSelection; } } else { //toggle.group = option.leafGroup; } ChargeRule(); }
/// <summary> /// 初始化环境 /// </summary> private void InitRoot() { option.ruleGetter = GetRule; option.axisType = root is HorizontalLayoutGroup ? GridLayoutGroup.Axis.Horizontal : GridLayoutGroup.Axis.Vertical; creater = new LineTreeItemCreater(0, root.transform, option); }