Skip to content

Commit dda5705

Browse files
author
Brian MacIntosh
committed
don't list empty/null objects as 'missing'
1 parent eec7cf7 commit dda5705

File tree

10 files changed

+199
-106
lines changed

10 files changed

+199
-106
lines changed

UnityProjectBrowser/MainForm.Designer.cs

Lines changed: 107 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnityProjectBrowser/MainForm.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ private void UpdateAllObjectsList()
239239
/// </summary>
240240
private void AddObject(ProjectObject obj)
241241
{
242+
if (obj.HideFromHierarchy)
243+
{
244+
return;
245+
}
246+
242247
string parentKey = GetParentKey(obj);
243248

244249
TreeNodeCollection addTo;
@@ -679,5 +684,15 @@ private void goToToolStripMenuItem_Click(object sender, EventArgs e)
679684
//TODO:
680685
}
681686
}
687+
688+
private void reparseToolStripMenuItem_Click(object sender, EventArgs e)
689+
{
690+
ProjectObject projectObject;
691+
if (allObjectsTreeView.SelectedNode != null
692+
&& ObjectDatabase.TryGetObject(allObjectsTreeView.SelectedNode.Name, out projectObject))
693+
{
694+
//TODO: discard existing relationships, re-trigger the correct feeder
695+
}
696+
}
682697
}
683698
}

UnityProjectBrowser/MainForm.resx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,9 @@
126126
<metadata name="filterLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
127127
<value>False</value>
128128
</metadata>
129-
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
130-
<value>17, 17</value>
131-
</metadata>
132129
<metadata name="toolStripSeparator1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
133130
<value>False</value>
134131
</metadata>
135-
<metadata name="mainStatusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
136-
<value>132, 17</value>
137-
</metadata>
138132
<metadata name="objectInspectorBox.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
139133
<value>False</value>
140134
</metadata>
@@ -153,6 +147,12 @@
153147
<metadata name="relationshipsLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
154148
<value>False</value>
155149
</metadata>
150+
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
151+
<value>17, 17</value>
152+
</metadata>
153+
<metadata name="mainStatusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
154+
<value>132, 17</value>
155+
</metadata>
156156
<metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
157157
<value>248, 17</value>
158158
</metadata>

UnityProjectBrowser/Parsers/BaseParser.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// MIT License
33

44
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Text;
8-
using System.Threading.Tasks;
95

106
namespace ProjectBrowser
117
{

UnityProjectBrowser/Parsers/UnityAssetParser.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using System.Linq;
8-
using System.Threading;
98
using YamlDotNet.RepresentationModel;
109

1110
namespace ProjectBrowser
1211
{
1312
public class UnityAssetParser : BaseParser
1413
{
14+
static UnityAssetParser()
15+
{
16+
// add a dummy object for "null"
17+
string emptyId = new UnityObjectKey(Guid.Empty, 0).ToString();
18+
ObjectDatabase.AddObject(emptyId, new NullObject(emptyId));
19+
}
20+
1521
/// <summary>
1622
/// Parses the specified file.
1723
/// </summary>

UnityProjectBrowser/Parsers/UnityMetaParser.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ namespace ProjectBrowser
99
{
1010
public class UnityMetaParser : BaseParser
1111
{
12+
static UnityMetaParser()
13+
{
14+
// add a dummy object for "null"
15+
string emptyGuid = Guid.Empty.ToString();
16+
ObjectDatabase.AddObject(emptyGuid, new NullObject(emptyGuid));
17+
}
18+
1219
/// <summary>
1320
/// Parses the specified file.
1421
/// </summary>

0 commit comments

Comments
 (0)