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

Commit 6d3bae9

Browse files
committed
Fix serialization of ChangesTreeNode
1 parent a529043 commit 6d3bae9

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

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

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,45 @@ public class ChangesTreeNodeDictionary : SerializableDictionary<string, ChangesT
1313
[Serializable]
1414
public class ChangesTreeNode : TreeNode
1515
{
16-
public string projectPath;
17-
public GitFileStatus gitFileStatus;
18-
public bool isLocked;
19-
20-
public GitStatusEntry GitStatusEntry { get; set; }
21-
22-
public string ProjectPath
23-
{
24-
get { return GitStatusEntry.projectPath; }
25-
}
26-
27-
public GitFileStatus GitFileStatus
28-
{
29-
get { return GitStatusEntry.status; }
30-
}
16+
[SerializeField] private bool isLocked;
17+
[SerializeField] private GitStatusEntry gitStatusEntry;
3118

3219
public bool IsLocked
3320
{
3421
get { return isLocked; }
3522
set { isLocked = value; }
3623
}
24+
public GitStatusEntry GitStatusEntry
25+
{
26+
get { return gitStatusEntry; }
27+
set { gitStatusEntry = value; }
28+
}
29+
30+
public string ProjectPath { get { return GitStatusEntry.projectPath; } }
31+
public GitFileStatus GitFileStatus { get { return GitStatusEntry.status; } }
3732
}
3833

3934
[Serializable]
4035
public class ChangesTree : Tree<ChangesTreeNode, GitStatusEntryTreeData>
4136
{
37+
[NonSerialized] public Texture2D FolderIcon;
38+
4239
[SerializeField] public ChangesTreeNodeDictionary assets = new ChangesTreeNodeDictionary();
4340
[SerializeField] public ChangesTreeNodeDictionary folders = new ChangesTreeNodeDictionary();
4441
[SerializeField] public ChangesTreeNodeDictionary checkedFileNodes = new ChangesTreeNodeDictionary();
45-
46-
[NonSerialized] public Texture2D FolderIcon;
4742
[SerializeField] public string title = string.Empty;
4843
[SerializeField] public string pathSeparator = "/";
4944
[SerializeField] public bool displayRootNode = true;
5045
[SerializeField] public bool isSelectable = true;
5146
[SerializeField] public bool isCheckable = false;
5247
[SerializeField] public bool isUsingGlobalSelection = false;
53-
[SerializeField] private List<ChangesTreeNode> nodes = new List<ChangesTreeNode>();
54-
[SerializeField] private ChangesTreeNode selectedNode = null;
48+
5549
[NonSerialized] private bool viewHasFocus;
5650
[NonSerialized] private Object lastActivatedObject;
5751

52+
[SerializeField] private List<ChangesTreeNode> nodes = new List<ChangesTreeNode>();
53+
[SerializeField] private ChangesTreeNode selectedNode = null;
54+
5855
public override string Title
5956
{
6057
get { return title; }

0 commit comments

Comments
 (0)