11using GBG . PlayableGraphMonitor . Editor . GraphView ;
22using GBG . PlayableGraphMonitor . Editor . Utility ;
33using System . Text ;
4+ using UnityEditor ;
45using UnityEditor . UIElements ;
56using UnityEngine ;
67using UnityEngine . Animations ;
@@ -113,9 +114,9 @@ protected override void OnUpdate(PlayableGraphViewUpdateContext updateContext, b
113114 // // _clipField.SetValueWithoutNotify(null);
114115 // }
115116
116- protected override void AppendNodeDescription ( StringBuilder descBuilder )
117+ protected override void AppendNodeDescription ( )
117118 {
118- base . AppendNodeDescription ( descBuilder ) ;
119+ base . AppendNodeDescription ( ) ;
119120
120121 if ( ! Playable . IsValid ( ) )
121122 {
@@ -125,44 +126,44 @@ protected override void AppendNodeDescription(StringBuilder descBuilder)
125126 var animClipPlayable = ( AnimationClipPlayable ) Playable ;
126127
127128 // IK
128- descBuilder . AppendLine ( LINE )
129- . Append ( "ApplyFootIK: " ) . AppendLine ( animClipPlayable . GetApplyFootIK ( ) . ToString ( ) )
130- . Append ( "ApplyPlayableIK: " ) . AppendLine ( animClipPlayable . GetApplyPlayableIK ( ) . ToString ( ) ) ;
129+ GUILayout . Label ( LINE ) ;
130+ EditorGUILayout . Toggle ( "ApplyFootIK:" , animClipPlayable . GetApplyFootIK ( ) ) ;
131+ EditorGUILayout . Toggle ( "ApplyPlayableIK:" , animClipPlayable . GetApplyPlayableIK ( ) ) ;
131132
132133 // Clip
133- descBuilder . AppendLine ( LINE ) ;
134+ GUILayout . Label ( LINE ) ;
134135 var clip = animClipPlayable . GetAnimationClip ( ) ;
135136 if ( ! clip )
136137 {
137- descBuilder . AppendLine ( "Clip: None" ) ;
138+ GUILayout . Label ( "Clip: None" ) ;
138139 return ;
139140 }
140141
141- descBuilder . Append ( "Clip: " ) . AppendLine ( clip . name )
142- . Append ( "Length: " ) . Append ( clip . length . ToString ( "F3" ) ) . AppendLine ( "( s)")
143- . Append ( "Looped: " ) . AppendLine ( clip . isLooping . ToString ( ) )
144- . Append ( "WrapMode: " ) . AppendLine ( clip . wrapMode . ToString ( ) )
145- . Append ( "FrameRate: " ) . AppendLine ( clip . frameRate . ToString ( "F3" ) )
146- . Append ( "Empty: " ) . AppendLine ( clip . empty . ToString ( ) )
147- . Append ( "Legacy: " ) . AppendLine ( clip . legacy . ToString ( ) )
148- . Append ( "HumanMotion: " ) . AppendLine ( clip . humanMotion . ToString ( ) )
149- . Append ( "HasMotionCurves: " ) . AppendLine ( clip . hasMotionCurves . ToString ( ) )
150- . Append ( "HasRootCurves: " ) . AppendLine ( clip . hasRootCurves . ToString ( ) )
151- . Append ( "HasGenericRootTransform: " ) . AppendLine ( clip . hasGenericRootTransform . ToString ( ) )
152- . Append ( "HasMotionFloatCurves: " ) . AppendLine ( clip . hasMotionFloatCurves . ToString ( ) )
153- . AppendLine ( "LocalBounds: " )
154- . Append ( " Center: " ) . AppendLine ( clip . localBounds . center . ToString ( ) )
155- . Append ( " Extends: " ) . AppendLine ( clip . localBounds . extents . ToString ( ) )
156- . Append ( "ApparentSpeed: " ) . AppendLine ( clip . apparentSpeed . ToString ( "F3" ) ) // Motion.cs
157- . Append ( "AverageSpeed: " ) . AppendLine ( clip . averageSpeed . ToString ( ) )
158- . Append ( "AverageAngularSpeed: " ) . AppendLine ( clip . averageAngularSpeed . ToString ( "F3" ) )
159- . Append ( "AverageDuration: " ) . AppendLine ( clip . averageDuration . ToString ( "F3" ) )
160- . Append ( "IsHumanMotion: " ) . AppendLine ( clip . isHumanMotion . ToString ( ) ) ;
142+ EditorGUILayout . ObjectField ( "Clip:" , clip , typeof ( AnimationClip ) , true ) ;
143+ GUILayout . Label ( $ "Length: { clip . length . ToString ( "F3" ) } ( s)") ;
144+ GUILayout . Label ( $ "Looped: { clip . isLooping } " ) ;
145+ GUILayout . Label ( $ "WrapMode: { clip . wrapMode } " ) ;
146+ GUILayout . Label ( $ "FrameRate: { clip . frameRate . ToString ( "F3" ) } " ) ;
147+ GUILayout . Label ( $ "Empty: { clip . empty } " ) ;
148+ GUILayout . Label ( $ "Legacy: { clip . legacy } " ) ;
149+ GUILayout . Label ( $ "HumanMotion: { clip . humanMotion } " ) ;
150+ GUILayout . Label ( $ "HasMotionCurves: { clip . hasMotionCurves } " ) ;
151+ GUILayout . Label ( $ "HasRootCurves: { clip . hasRootCurves } " ) ;
152+ GUILayout . Label ( $ "HasGenericRootTransform: { clip . hasGenericRootTransform } " ) ;
153+ GUILayout . Label ( $ "HasMotionFloatCurves: { clip . hasMotionFloatCurves } " ) ;
154+ GUILayout . Label ( $ "LocalBounds: ") ;
155+ GUILayout . Label ( $ " Center: { clip . localBounds . center } " ) ;
156+ GUILayout . Label ( $ " Extends: { clip . localBounds . extents } " ) ;
157+ GUILayout . Label ( $ "ApparentSpeed: { clip . apparentSpeed . ToString ( "F3" ) } " ) ; // Motion.cs
158+ GUILayout . Label ( $ "AverageSpeed: { clip . averageSpeed } " ) ;
159+ GUILayout . Label ( $ "AverageAngularSpeed: { clip . averageAngularSpeed . ToString ( "F3" ) } " ) ;
160+ GUILayout . Label ( $ "AverageDuration: { clip . averageDuration . ToString ( "F3" ) } " ) ;
161+ GUILayout . Label ( $ "IsHumanMotion: { clip . isHumanMotion } " ) ;
161162
162163 // Event
163- descBuilder . AppendLine ( LINE ) ;
164+ GUILayout . Label ( LINE ) ;
164165 var events = clip . events ;
165- descBuilder . AppendLine (
166+ GUILayout . Label (
166167 events . Length == 0
167168 ? "No Event"
168169 : ( events . Length == 1 ? "1 Event:" : $ "{ events . Length . ToString ( ) } Events:")
@@ -171,7 +172,7 @@ protected override void AppendNodeDescription(StringBuilder descBuilder)
171172 {
172173 var evt = events [ i ] ;
173174 var evtPosition = evt . time / clip . length * 100 ;
174- descBuilder . AppendLine ( $ " #{ ( i + 1 ) . ToString ( ) } { evtPosition . ToString ( "F2" ) } % { evt . functionName } ") ;
175+ GUILayout . Label ( $ " #{ ( i + 1 ) } { evtPosition . ToString ( "F2" ) } % { evt . functionName } ") ;
175176 }
176177 }
177178 }
0 commit comments