Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I transplanted their behavior tree Debug window from fluid-behavior-tree #35

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
!W(Editor) add Label
  • Loading branch information
yika-aixi committed Aug 8, 2020
commit 846bf581f1023012773c23cb53746067a929ccea
12 changes: 10 additions & 2 deletions Editor/DebuggerEditor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using CleverCrow.Fluid.BTs.Trees.Editors;
using UnityEditor;
using UnityEngine;

Expand All @@ -10,14 +11,21 @@ public class DebuggerEditor : Editor
{
public override void OnInspectorGUI()
{
GUILayout.Label($"NPBehave Debugger {(target as Debugger).Label}", EditorStyles.centeredGreyMiniLabel);
var debugger = (Debugger) target;

GUILayout.Label($"NPBehave Debugger {debugger.Label}", EditorStyles.centeredGreyMiniLabel);

if (GUILayout.Button("Open Debugger"))
{
DebuggerWindow.selectedDebugger = ((Debugger)target);
DebuggerWindow.selectedDebugger = debugger;
DebuggerWindow.selectedObject = DebuggerWindow.selectedDebugger.transform;
DebuggerWindow.ShowWindow();
}

if (GUILayout.Button("Open Tree Window"))
{
BehaviorTreeWindow.ShowTree(debugger.BehaviorTree, debugger.Label);
}
}
}
}