using UnityEngine;
using System.Collections.Generic;
using UnityEngine.UI;
using DevelopEngine;
using AX.MessageSystem;
using System;
using System.IO;
using System.Collections;
using UnityEngine.EventSystems;
//using UIManage;
///
/// 树形菜单控制器
///
public class TreeViewControl__ : SingletonMono, IPointerEnterHandler
{
///
/// 当前树形菜单的数据源
///
[HideInInspector]
public List Data = null;
///
/// 树形菜单中元素的模板
///
public GameObject Template;
///
/// 树形菜单中元素的根物体
///
public Transform TreeItems;
///
/// 树形菜单的纵向排列间距
///
public int VerticalItemSpace = 2;
///
/// 树形菜单的横向排列间距
///
public int HorizontalItemSpace = 25;
///
/// 树形菜单中元素的宽度
///
public int ItemWidth = 230;
///
/// 树形菜单中元素的高度
///
public int ItemHeight = 35;
///
/// 所有子元素的鼠标点击回调事件
///
public delegate void ClickItemdelegate(GameObject item);
public event ClickItemdelegate ClickItemEvent;
//当前树形菜单中的所有元素
public List _treeViewItems;
//当前树形菜单中的所有元素克隆体(刷新树形菜单时用于过滤计算)
private List _treeViewItemsClone;
//树形菜单当前刷新队列的元素位置索引
private int _yIndex = 0;
//树形菜单当前刷新队列的元素最大层级
private int _hierarchy = 0;
///
/// 标志图层数据是否被编辑过的标志位
///
public bool HasEditFlag = false;
public bool ViewButtonHoverTipFlag = false;
private GameObject TipText;
Canvas canvas;
GameObject objTemp;
RectTransform rectContent;
private GameObject btns;
void Awake()
{
ClickItemEvent += ClickItemTemplate;
TipText = transform.Find("TipText").gameObject;
//TransformHelper.FindChild(transform, "Viewport").gameObject.AddComponent();
//TransformHelper.FindChild(transform, "Content").gameObject.AddComponent();
}
void Start()
{
GetLayersData();
GenerateTreeView();
ChangeChildren(false);
RefreshTreeView();
rectContent = TransformHelper.FindChild(transform,"Content").GetComponent();
rectTree = GetComponent();
rect = new Rect(0, -rectTree.sizeDelta.y, rectTree.sizeDelta.x, rectTree.sizeDelta.y);
canvas = GameObject.Find("Canvas").GetComponent