Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
cba15236
Commit
cba15236
authored
Mar 27, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改进XMind转Unity配置
parent
f9a1629c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
5 deletions
+52
-5
MainWindow.xaml.cs
读取xmind/WpfApp1/WpfApp1/MainWindow.xaml.cs
+1
-1
Xmind2UnityConfigUI.csproj
读取xmind/WpfApp1/WpfApp1/Xmind2UnityConfigUI.csproj
+1
-1
Program.cs
读取xmind/WpfApp1/Xmind2UnityConfig/Program.cs
+7
-3
TopicExt.cs
读取xmind/WpfApp1/Xmind2UnityConfigCore/TopicExt.cs
+11
-0
XMindType.cs
读取xmind/WpfApp1/Xmind2UnityConfigCore/XMindType.cs
+30
-0
XMindTypeExt.cs
读取xmind/WpfApp1/Xmind2UnityConfigCore/XMindTypeExt.cs
+0
-0
Xmind2UnityConfigCore.csproj
...pfApp1/Xmind2UnityConfigCore/Xmind2UnityConfigCore.csproj
+2
-0
No files found.
读取xmind/WpfApp1/WpfApp1/MainWindow.xaml.cs
View file @
cba15236
...
...
@@ -43,7 +43,7 @@ namespace WpfApp1
{
string
xmindPath
=
openFileDialog
.
FileName
;
string
outDirPath
=
System
.
IO
.
Path
.
GetDirectoryName
(
xmindPath
);
if
(
Xmind2UnityConfigCore
.
TopicExt
.
ToUnity
(
openFileDialog
.
FileName
,
null
)
==
0
)
{
if
(
Xmind2UnityConfigCore
.
XMindTypeExt
.
ToUnity
(
openFileDialog
.
FileName
,
null
,
true
)
==
0
)
{
MessageBox
.
Show
(
$@"完成 输出到
{
outDirPath
}
\unity"
);
}
}
...
...
读取xmind/WpfApp1/WpfApp1/Xmind2UnityConfigUI.csproj
View file @
cba15236
...
...
@@ -5,7 +5,7 @@
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{840673C1-3705-42EC-A3EB-6A7F803590CF}
</ProjectGuid>
<OutputType>
Win
Exe
</OutputType>
<OutputType>
Exe
</OutputType>
<RootNamespace>
Xmind2UnityConfigUI
</RootNamespace>
<AssemblyName>
Xmind2UnityConfigUI
</AssemblyName>
<TargetFrameworkVersion>
v4.6.1
</TargetFrameworkVersion>
...
...
读取xmind/WpfApp1/Xmind2UnityConfig/Program.cs
View file @
cba15236
...
...
@@ -17,11 +17,15 @@ namespace Xmind2UnityConfig
}
else
if
(
args
.
Length
==
1
)
{
return
Xmind2UnityConfigCore
.
TopicExt
.
ToUnity
(
args
[
0
],
null
);
return
Xmind2UnityConfigCore
.
XMindTypeExt
.
ToUnity
(
args
[
0
],
null
,
true
);
}
else
else
if
(
args
.
Length
==
2
)
{
return
Xmind2UnityConfigCore
.
TopicExt
.
ToUnity
(
args
[
0
],
args
[
1
]);
return
Xmind2UnityConfigCore
.
XMindTypeExt
.
ToUnity
(
args
[
0
],
args
[
1
],
true
);
}
else
// if (args.Length == 2)
{
return
Xmind2UnityConfigCore
.
XMindTypeExt
.
ToUnity
(
args
[
0
],
args
[
1
],
bool
.
Parse
(
args
[
2
]));
}
}
}
...
...
读取xmind/WpfApp1/Xmind2UnityConfigCore/TopicExt.cs
View file @
cba15236
...
...
@@ -39,6 +39,12 @@ namespace Xmind2UnityConfigCore
string
filePath
=
System
.
IO
.
Path
.
Combine
(
tempPath
,
"content.json"
);
string
json
=
File
.
ReadAllText
(
filePath
);
//var xmind = JsonConvert.DeserializeObject<XMindRootTopic[]>(json);
//转义title
//string unescape = System.Text.RegularExpressions.Regex.Unescape(str);
JArray
jArray
=
JsonConvert
.
DeserializeObject
(
json
)
as
JArray
;
var
jobject_topic
=
jArray
.
First
()
as
JObject
;
...
...
@@ -82,6 +88,7 @@ namespace Xmind2UnityConfigCore
return
topic
;
}
static
void
ToUnity
(
Topic
rootTopic
,
string
path
)
{
path
=
System
.
IO
.
Path
.
Combine
(
path
,
"unity"
);
...
...
@@ -97,6 +104,8 @@ namespace Xmind2UnityConfigCore
File
.
WriteAllText
(
System
.
IO
.
Path
.
Combine
(
path
,
"relationship.json"
),
json
);
}
static
RelationShip
ToRelationShip
(
Topic
topic
,
string
path
)
{
RelationShip
relationShip
=
new
RelationShip
();
...
...
@@ -291,4 +300,6 @@ namespace Xmind2UnityConfigCore
xdoc
.
Save
(
filepath
);
}
}
}
读取xmind/WpfApp1/Xmind2UnityConfigCore/XMindType.cs
0 → 100644
View file @
cba15236
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Xmind2UnityConfigCore
{
public
class
XMindRootTopic
{
public
XMindTopic
rootTopic
;
public
override
string
ToString
()
{
return
rootTopic
.
ToString
();
}
}
public
class
XMindTopic
{
public
string
title
;
public
XMindChildren
children
;
public
override
string
ToString
()
{
return
title
;
}
}
public
class
XMindChildren
{
public
List
<
XMindTopic
>
attached
;
}
}
读取xmind/WpfApp1/Xmind2UnityConfigCore/XMindTypeExt.cs
0 → 100644
View file @
cba15236
This diff is collapsed.
Click to expand it.
读取xmind/WpfApp1/Xmind2UnityConfigCore/Xmind2UnityConfigCore.csproj
View file @
cba15236
...
...
@@ -46,6 +46,8 @@
<Compile
Include=
"Topic.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"TopicExt.cs"
/>
<Compile
Include=
"XMindType.cs"
/>
<Compile
Include=
"XMindTypeExt.cs"
/>
</ItemGroup>
<ItemGroup>
<PackageReference
Include=
"Newtonsoft.Json"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment