File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ public static PlayableGraphMonitorWindow Open()
1919 }
2020
2121
22- private readonly List < PlayableGraph > _graphs = new List < PlayableGraph > ( ) ;
22+ private readonly List < PlayableGraph > _graphs = new List < PlayableGraph >
23+ {
24+ new PlayableGraph ( ) // a invalid graph, for compatibility with Unity 2019
25+ } ;
2326
2427 private Toolbar _toolbar ;
2528
@@ -187,13 +190,13 @@ private void OnDestroyingGraph(PlayableGraph graph)
187190 private void UpdatePlayableGraphPopupField ( )
188191 {
189192 var index = _graphs . IndexOf ( _graphPopupField . value ) ;
190- if ( index == - 1 && _graphs . Count > 0 )
193+ if ( index < 1 )
191194 {
192- index = 0 ;
195+ index = _graphs . Count - 1 ;
193196 }
194197
195198 _graphPopupField . index = index ;
196- _graphPopupField . value = index > - 1 ? _graphs [ index ] : new PlayableGraph ( ) ;
199+ _graphPopupField . value = _graphs [ index ] ;
197200 _graphPopupField . MarkDirtyRepaint ( ) ;
198201 }
199202
Original file line number Diff line number Diff line change 22 "name" : " com.greenbamboogames.playablegraphmonitor" ,
33 "version" : " 0.0.1" ,
44 "displayName" : " PlayableGraphMonitor!" ,
5- "description" : " Playable graph monitor." ,
6- "unity" : " 2021.3 " ,
5+ "description" : " PlayableGraph monitor." ,
6+ "unity" : " 2019.4 " ,
77 "documentationUrl" : " https://github.com/SolarianZ/UnityPlayableGraphMonitorTool" ,
88 "changelogUrl" : " " ,
99 "licensesUrl" : " https://github.com/SolarianZ/UnityPlayableGraphMonitorTool/blob/main/LICENSE" ,
You can’t perform that action at this time.
0 commit comments