private void LoadTreeByTreeData() { string path = EditorUtility.OpenFilePanel("加载数据", Application.dataPath, "bytes"); if (path.Length != 0) { //通过前后缀确定当前数据是哪种类型,需要先切换到当前类型,在加载数据,否则数据有可能不对 NEData neData = NEUtil.DeSerializerObject(path, typeof(NEData), m_lstNodeDataType.ToArray()) as NEData; CreateTreeByTreeData(neData); } }
private void LoadTreeByTreeData() { if (m_nTreeComposeIndex < 0 || m_nTreeComposeIndex > NEConfig.arrTreeComposeData.Length) { Debug.Log("需要选择树的类型"); return; } var composeData = NEConfig.arrTreeComposeData[m_nTreeComposeIndex]; string dir = composeData.fileDir; if (dir.StartsWith("Assets")) { dir = dir.Replace("Assets", ""); } string path = EditorUtility.OpenFilePanel("加载数据", Application.dataPath + dir, composeData.fileExt); if (path.Length != 0) { //通过前后缀确定当前数据是哪种类型,需要先切换到当前类型,在加载数据,否则数据有可能不对 NEData neData = NEUtil.DeSerializerObject(path, typeof(NEData), m_lstNodeDataType.ToArray()) as NEData; CreateTreeByTreeData(neData); } }