-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b13887
commit fb19042
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using OpenTS2.Content; | ||
using OpenTS2.Game; | ||
using OpenTS2.SimAntics; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace OpenTS2 | ||
{ | ||
[CustomEditor(typeof(NeighborManager))] | ||
public class NeighborManagerEditor : Editor | ||
{ | ||
private bool _showNeighbors = false; | ||
public override void OnInspectorGUI() | ||
{ | ||
DrawDefaultInspector(); | ||
var neighborManager = target as NeighborManager; | ||
_showNeighbors = EditorGUILayout.Foldout(_showNeighbors, "Neighbors"); | ||
if (_showNeighbors) | ||
{ | ||
var neighbors = neighborManager.Neighbors; | ||
EditorGUI.indentLevel++; | ||
foreach(var neighbor in neighbors) | ||
{ | ||
GUILayout.BeginVertical("box"); | ||
GUILayout.Label($"{neighbor.ObjectDefinition.FileName}"); | ||
GUILayout.Label($"Neighbor ID {neighbor.Id}"); | ||
GUILayout.Label($"Object GUID 0x{neighbor.GUID:X8}"); | ||
GUILayout.EndVertical(); | ||
} | ||
EditorGUI.indentLevel--; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.