using UnityEngine; using UnityEngine.UI; using System.Collections.Generic; using System; using AX.MessageSystem; using UnityEngine.EventSystems; using System.IO; using System.Collections; /// /// 树形菜单元素 /// public class TreeViewItem__ : MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDragHandler { /// /// 树形菜单控制器 /// public TreeViewControl__ Controler; /// /// 当前元素的子元素是否展开(展开时可见) /// public bool IsExpanding = false; //当前元素的ID public int ID; //当前元素的parentID public int parentID; //当前元素的名称 public string Name; //当前元素在树形图中所属的层级 private int _hierarchy = 0; //当前元素指向的父元素 private TreeViewItem__ _parent; //当前元素的所有子元素 private List _children; public int maxHierarchy = 5; private Button TreeViewButtonDelete; private Button TreeViewButtonAdd; private Button TreeViewButtonEdit; void Start() { Init(); } private void Init() { rectViewPort = transform.parent.parent.parent.GetComponent(); canvas = GameObject.Find("Canvas").GetComponent(); TreeViewButtonDelete = TransformHelper.FindChild(transform, "TreeViewButtonDelete").GetComponent