Example #1
0
    private void LoadData()
    {
        if (Application.isPlaying)
        {
            UtilityCanOrCantWindows.CreateWindows("Error", "正在运行请停止后重试", null, null);
            return;
        }

        if (data != null)
        {
            string path = AssetDatabase.GetAssetPath(data);
            if (type == DataTreeEditWindowType.Create && !Path.GetExtension(path).Equals(".csv"))
            {
                EditorUtility.DisplayDialog("提示", "需要读取的数据集错误!", "确定");
                return;
            }

            if (type == DataTreeEditWindowType.Load && !data.name.Contains("Tree"))
            {
                EditorUtility.DisplayDialog("提示", "需要读取的数据树错误!", "确定");
                return;
            }

            DataTreeEditWindows windows = EditorWindow.GetWindow <DataTreeEditWindows>();

            windows.autoRepaintOnSceneChange = true;
            windows.titleContent             = new GUIContent("编辑数据树");
            windows.minSize = new Vector2(1600, 1000);
            windows.InitData(data.name);

            windows.Show();

            this.Close();
        }
    }
Example #2
0
    private void LoadMap()
    {
        if (Application.isPlaying)
        {
            UtilityCanOrCantWindows.CreateWindows("Error", "正在运行请停止后重试", null, null);
            return;
        }

        if (map != null)
        {
            EditorSceneManager.OpenScene(editorScene);
            GameObject.Instantiate(map);
            map.transform.localScale = Vector3.one;
            showVertexs = true;
        }
    }