コード例 #1
0
    private void ExportSelectedSceneNodes()
    {
        string path = EditorUtility.SaveFilePanel("请选择要导出的dsl文件", string.Empty, string.Empty, "dsl");

        if (!string.IsNullOrEmpty(path))
        {
            if (File.Exists(path))
            {
                File.Delete(path);
            }
            foreach (GameObject obj in Selection.gameObjects)
            {
                UiEditUtility.Export(path, obj);
                Debug.Log("BatchExportAll " + obj.name);
            }
            EditorUtility.DisplayDialog("提示", "处理完成", "ok");
        }
    }
コード例 #2
0
    private void ExportSelectedPrefabs()
    {
        string path = EditorUtility.SaveFilePanel("请选择要导出的dsl文件", string.Empty, string.Empty, "dsl");

        if (!string.IsNullOrEmpty(path))
        {
            if (File.Exists(path))
            {
                File.Delete(path);
            }
            foreach (ItemInfo item in m_Prefabs)
            {
                if (item.Selected)
                {
                    if (null != item.Prefab)
                    {
                        UiEditUtility.Export(path, item.Prefab);
                        Debug.Log("BatchExportAll " + item.Path);
                    }
                }
            }
            EditorUtility.DisplayDialog("提示", "处理完成", "ok");
        }
    }