File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using GBG . PlayableGraphMonitor . Editor . Node ;
2+ using GBG . PlayableGraphMonitor . Editor . Utility ;
23using System . Collections . Generic ;
4+ using UnityEditor ;
35using UnityEditor . Experimental . GraphView ;
46using UnityEngine ;
57using UnityEngine . Playables ;
@@ -25,7 +27,10 @@ public PlayableGraphView()
2527
2628 public void Update ( PlayableGraph playableGraph )
2729 {
30+ var needFrameAll = ! GraphTool . IsEqual ( ref _playableGraph , ref playableGraph ) ;
31+
2832 _playableGraph = playableGraph ;
33+
2934 if ( ! _playableGraph . IsValid ( ) )
3035 {
3136 ClearView ( ) ;
@@ -34,6 +39,15 @@ public void Update(PlayableGraph playableGraph)
3439 PopulateView ( ) ;
3540
3641 CalculateLayout ( ) ;
42+
43+ if ( needFrameAll )
44+ {
45+ // wait for view initialize at least 2 frames
46+ EditorApplication . delayCall += ( ) =>
47+ {
48+ EditorApplication . delayCall += ( ) => { FrameAll ( ) ; } ;
49+ } ;
50+ }
3751 }
3852
3953
You can’t perform that action at this time.
0 commit comments