File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public PlayableGraphView()
2121 {
2222 this . AddManipulator ( new ContentDragger ( ) ) ;
2323 //this.AddManipulator(new SelectionDragger());
24- // this.AddManipulator(new RectangleSelector());
24+ this . AddManipulator ( new RectangleSelector ( ) ) ;
2525 SetupZoom ( ContentZoomer . DefaultMinScale , ContentZoomer . DefaultMaxScale ) ;
2626 }
2727
Original file line number Diff line number Diff line change 11using System . Text ;
2+ using UnityEditor . UIElements ;
23using UnityEngine . Animations ;
34using UnityEngine . Playables ;
45
56namespace GBG . PlayableGraphMonitor . Editor . Node
67{
78 public class AnimationClipPlayableNode : PlayableNode
89 {
10+ private ProgressBar _progressBar ;
11+
12+
913 public AnimationClipPlayableNode ( Playable playable ) : base ( playable )
1014 {
15+ _progressBar = new ProgressBar ( ) ;
16+ // insert between title and port container
17+ titleContainer . parent . Insert ( 1 , _progressBar ) ;
18+ }
19+
20+ public override void Update ( )
21+ {
22+ if ( Playable . IsValid ( ) )
23+ {
24+ var clipPlayable = ( AnimationClipPlayable ) Playable ;
25+ var clip = clipPlayable . GetAnimationClip ( ) ;
26+ var duration = clip ? clip . length : float . PositiveInfinity ;
27+ var progress = ( float ) ( Playable . GetTime ( ) / duration ) % 1.0f * 100 ;
28+ _progressBar . SetValueWithoutNotify ( progress ) ;
29+ _progressBar . MarkDirtyRepaint ( ) ;
30+ }
31+
32+ base . Update ( ) ;
1133 }
1234
1335
You can’t perform that action at this time.
0 commit comments