Skip to content

Commit 80e9b3d

Browse files
authored
feat: Improve UI
1 parent 1601b5f commit 80e9b3d

3 files changed

Lines changed: 26 additions & 9 deletions

File tree

Editor/Scripts/Node/AnimationScriptPlayableNode.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using System;
1+
using GBG.PlayableGraphMonitor.Editor.GraphView;
2+
using System;
23
using System.Reflection;
34
using System.Text;
4-
using GBG.PlayableGraphMonitor.Editor.GraphView;
55
using UnityEngine;
6+
using UnityEngine.Animations;
7+
using UnityEngine.Playables;
68
using UnityEngine.UIElements;
79

8-
910
namespace GBG.PlayableGraphMonitor.Editor.Node
1011
{
1112
public class AnimationScriptPlayableNode : PlayableNode
@@ -58,6 +59,19 @@ protected override void AppendPlayableTypeDescription(StringBuilder descBuilder)
5859
descBuilder.Append("Job: ").AppendLine(jobType?.Name ?? "?");
5960
}
6061

62+
protected override void AppendNodeDescription(StringBuilder descBuilder)
63+
{
64+
base.AppendNodeDescription(descBuilder);
65+
66+
if (!Playable.IsValid())
67+
{
68+
return;
69+
}
70+
71+
var animScriptPlayable = (AnimationScriptPlayable)Playable;
72+
descBuilder.AppendLine(LINE)
73+
.Append("ProcessInputs: ").AppendLine(animScriptPlayable.GetProcessInputs().ToString());
74+
}
6175

6276
private Type GetJobType()
6377
{

Editor/Scripts/Node/PlayableNode.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System;
1+
using GBG.PlayableGraphMonitor.Editor.GraphView;
2+
using GBG.PlayableGraphMonitor.Editor.Utility;
3+
using System;
24
using System.Collections.Generic;
35
using System.Text;
4-
using GBG.PlayableGraphMonitor.Editor.GraphView;
5-
using GBG.PlayableGraphMonitor.Editor.Utility;
66
using UnityEditor.Experimental.GraphView;
77
using UnityEngine;
88
using UnityEngine.Playables;
@@ -185,7 +185,7 @@ protected override void AppendNodeDescription(StringBuilder descBuilder)
185185
protected virtual void AppendPlayableTypeDescription(StringBuilder descBuilder)
186186
{
187187
descBuilder.Append("Type: ").AppendLine(Playable.GetPlayableType()?.Name ?? "?")
188-
.Append("HashCode: ").AppendLine(Playable.GetHandle().GetHashCode().ToString());
188+
.Append("HandleHashCode: ").AppendLine(Playable.GetHandle().GetHashCode().ToString());
189189
}
190190

191191
protected virtual void AppendInputPortDescription(StringBuilder descBuilder)
@@ -210,9 +210,12 @@ protected virtual void AppendInputPortDescription(StringBuilder descBuilder)
210210
/// <returns></returns>
211211
public Port FindOutputPort(Playable outputPlayable)
212212
{
213-
// If the output of Playable at index i is connected to a PlayableOutput,
213+
// If the output port of the Playable at index i is connected to a PlayableOutput,
214214
// Playable.GetOutput(i) will return an invalid Playable.
215215

216+
// TODO FIXME: If multiple output ports of `outputPlayable` connect to different input ports of the same `Playable`,
217+
// this method cannot distinguish between these output ports.
218+
216219
for (int i = 0; i < Playable.GetOutputCount(); i++)
217220
{
218221
var output = Playable.GetOutput(i);

Editor/Scripts/Node/PlayableOutputNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected override void AppendNodeDescription(StringBuilder descBuilder)
106106

107107
descBuilder.Append("#").AppendLine(_outputIndex.ToString())
108108
.Append("Type: ").AppendLine(PlayableOutput.GetPlayableOutputType().Name)
109-
.Append("HashCode: ").AppendLine(PlayableOutput.GetHandle().GetHashCode().ToString())
109+
.Append("HandleHashCode: ").AppendLine(PlayableOutput.GetHandle().GetHashCode().ToString())
110110
.AppendLine(LINE)
111111
.Append("Name: ").AppendLine(PlayableOutput.GetEditorName())
112112
.AppendLine(LINE)

0 commit comments

Comments
 (0)