Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 1087add

Browse files
Making the path separator configurable
1 parent 6dc2dd0 commit 1087add

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public abstract class Tree
2020
[SerializeField] public Rect Margin = new Rect();
2121
[SerializeField] public Rect Padding = new Rect();
2222

23+
[SerializeField] public string PathSeparator = "/";
2324
[SerializeField] public GUIStyle FolderStyle;
2425
[SerializeField] public GUIStyle TreeNodeStyle;
2526
[SerializeField] public GUIStyle ActiveTreeNodeStyle;
@@ -73,12 +74,12 @@ public void Load(IEnumerable<ITreeData> data, string title)
7374

7475
foreach (var d in data)
7576
{
76-
var parts = d.Name.Split('/');
77+
var parts = d.Name.Split(new [] {PathSeparator}, StringSplitOptions.None);
7778
for (int i = 0; i < parts.Length; i++)
7879
{
7980
var label = parts[i];
8081
var level = i + 1;
81-
var name = String.Join("/", parts, 0, level);
82+
var name = String.Join(PathSeparator, parts, 0, level);
8283
var isFolder = i < parts.Length - 1;
8384
var alreadyExists = folders.ContainsKey(name);
8485
if (!alreadyExists)

0 commit comments

Comments
 (0)