Skip to content

Commit f00fe45

Browse files
committed
Tiny cleanings for code readability
1 parent f1202ff commit f00fe45

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

Editor/PlayableGraphVisualizer.cs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public override Type GetContentType()
5050
Playable p = Playable.Null;
5151
try
5252
{
53-
p = ((Playable)content);
53+
p = (Playable) content;
5454
}
5555
catch
5656
{
5757
// Ignore.
5858
}
59-
return !p.IsValid() ? null : p.GetPlayableType();
59+
return p.IsValid() ? p.GetPlayableType() : null;
6060
}
6161

6262
public override string GetContentTypeShortName()
@@ -73,20 +73,18 @@ public override string ToString()
7373

7474
sb.AppendLine(InfoString("Handle", GetContentTypeShortName()));
7575

76-
var h = (Playable)content;
77-
78-
sb.AppendLine(InfoString("IsValid", h.IsValid()));
79-
80-
if (h.IsValid())
76+
var p = (Playable) content;
77+
sb.AppendLine(InfoString("IsValid", p.IsValid()));
78+
if (p.IsValid())
8179
{
82-
sb.AppendLine(InfoString("IsDone", h.IsDone()));
83-
sb.AppendLine(InfoString("InputCount", h.GetInputCount()));
84-
sb.AppendLine(InfoString("OutputCount", h.GetOutputCount()));
85-
sb.AppendLine(InfoString("PlayState", h.GetPlayState()));
86-
sb.AppendLine(InfoString("Speed", h.GetSpeed()));
87-
sb.AppendLine(InfoString("Duration", h.GetDuration()));
88-
sb.AppendLine(InfoString("Time", h.GetTime()));
89-
// sb.AppendLine(InfoString("Animation", h.animatedProperties));
80+
sb.AppendLine(InfoString("IsDone", p.IsDone()));
81+
sb.AppendLine(InfoString("InputCount", p.GetInputCount()));
82+
sb.AppendLine(InfoString("OutputCount", p.GetOutputCount()));
83+
sb.AppendLine(InfoString("PlayState", p.GetPlayState()));
84+
sb.AppendLine(InfoString("Speed", p.GetSpeed()));
85+
sb.AppendLine(InfoString("Duration", p.GetDuration()));
86+
sb.AppendLine(InfoString("Time", p.GetTime()));
87+
//sb.AppendLine(InfoString("Animation", p.animatedProperties));
9088
}
9189

9290
return sb.ToString();
@@ -102,16 +100,16 @@ public PlayableOutputNode(PlayableOutput content)
102100

103101
public override Type GetContentType()
104102
{
105-
PlayableOutput p = PlayableOutput.Null;
103+
PlayableOutput po = PlayableOutput.Null;
106104
try
107105
{
108-
p = ((PlayableOutput)content);
106+
po = (PlayableOutput) content;
109107
}
110108
catch
111109
{
112110
// Ignore.
113111
}
114-
return !p.IsOutputValid() ? null : p.GetPlayableOutputType();
112+
return po.IsOutputValid() ? po.GetPlayableOutputType() : null;
115113
}
116114

117115
public override string GetContentTypeShortName()
@@ -128,9 +126,8 @@ public override string ToString()
128126

129127
sb.AppendLine(InfoString("Handle", GetContentTypeShortName()));
130128

131-
var h = (PlayableOutput)content;
132-
133-
sb.AppendLine(InfoString("IsValid", h.IsOutputValid()));
129+
var po = (PlayableOutput) content;
130+
sb.AppendLine(InfoString("IsValid", po.IsOutputValid()));
134131

135132
return sb.ToString();
136133
}
@@ -166,7 +163,7 @@ protected override IEnumerable<Node> GetChildren(Node node)
166163
// Children are the Playable Inputs.
167164
if(node is PlayableNode)
168165
return GetInputsFromPlayableNode((Playable)node.content);
169-
else if(node is PlayableOutputNode)
166+
if(node is PlayableOutputNode)
170167
return GetInputsFromPlayableOutputNode((PlayableOutput)node.content);
171168

172169
return new List<Node>();

0 commit comments

Comments
 (0)