private void GUIRenderTreeNode(FTPTreeGUI.TreeNode node) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button((!node.IsOpen) ? " + " : " - ", this.treeHandleStyle, new GUILayoutOption[0])) { node.IsOpen = !node.IsOpen; if (node.Children.Count == 0 && node.IsPath()) { this.GetFTPSubPath(node); } } if (node.IsOpen) { GUILayout.BeginVertical(new GUILayoutOption[0]); if (GUILayout.Button(node.Text, this.textStyle, new GUILayoutOption[0])) { this.CheckExpandAll(Event.current, node); } foreach (FTPTreeGUI.TreeNode current in node.Children) { this.GUIRenderTreeNode(current); } GUILayout.EndVertical(); } else if (GUILayout.Button(node.Text, this.textStyle, new GUILayoutOption[0])) { this.CheckExpandAll(Event.current, node); } if (node.Children.Count == 0 && node.IsLoadType() && GUILayout.Button("Load", this.btnStyle, new GUILayoutOption[0])) { node.LoadURL(); } GUILayout.EndHorizontal(); }
private void CheckExpandAll(Event evt, FTPTreeGUI.TreeNode node) { if (evt.button == 0 && evt.clickCount == 2) { node.SetOpenRecursively(!node.IsOpen); } }
private FTPTreeGUI.TreeNode GenerateTree(int depth, int breadth, string sText) { FTPTreeGUI.TreeNode treeNode = new FTPTreeGUI.TreeNode(sText); if (depth > 0) { for (int i = 0; i < breadth; i++) { treeNode.AddChild(this.GenerateTree(depth - 1, breadth, string.Concat(new object[] { "Node ", depth, ":", i }))); } } return(treeNode); }
public void AddChild(FTPTreeGUI.TreeNode node) { this.mlstChildren.Add(node); }
private void Awake() { this.mTree = new FTPTreeGUI.TreeNode("FTP VIEWER"); this.mTree.URL = this.BaseURL + this.SEARCH_PATH; this.GetFTPSubPath(this.mTree); }
private void GetFTPSubPath(FTPTreeGUI.TreeNode _Node) { }