@@ -112,9 +112,6 @@ static void InitializeOnLoad()
112112 [ MenuItem ( "EVMC4U/Oepn Tutorial" ) ]
113113 public static void Open ( )
114114 {
115- //一度開いたのを覚えておく
116- EditorUserSettings . SetConfigValue ( "Opened" , "1" ) ;
117-
118115 //ウィンドウサイズを固定
119116 var window = GetWindow < Tutorial > ( ) ;
120117 window . maxSize = new Vector2 ( window_w , window_h - 6 ) ;
@@ -126,6 +123,12 @@ public static void Open()
126123 anim . target = 0.001f ;
127124 anim . valueChanged = null ;
128125
126+ if ( Resources . Load < TextAsset > ( "tutorial/define" ) == null )
127+ {
128+ //読み込み準備ができていない
129+ return ;
130+ }
131+
129132 //ページを初期位置に設定
130133 page = "start" ;
131134 if ( EditorUserSettings . GetConfigValue ( "Language" ) == "ja" )
@@ -144,28 +147,32 @@ public static void Open()
144147 try
145148 {
146149 jsonError = "" ;
147- tutorialJson = JsonUtility . FromJson < TutorialJson > ( Resources . Load < TextAsset > ( "tutorial/define" ) . text ) ;
150+ var r = Resources . Load < TextAsset > ( "tutorial/define" ) ;
151+ tutorialJson = JsonUtility . FromJson < TutorialJson > ( r . text ) ;
148152 if ( tutorialJson . debug )
149153 {
150154 Debug . Log ( tutorialJson ) ;
151155 }
156+
157+ //各ページのデータを読み込む
158+ foreach ( var p in tutorialJson . pages )
159+ {
160+ tutorialPages . Add ( p . name , p ) ;
161+ if ( tutorialJson . debug )
162+ {
163+ Debug . Log ( p ) ;
164+ }
165+ }
166+
167+ //一度開いたのを覚えておく
168+ EditorUserSettings . SetConfigValue ( "Opened" , "1" ) ;
152169 }
153170 catch ( ArgumentException e ) {
154- Debug . LogError ( e ) ;
171+ // Debug.LogError(e);
155172 jsonError = e . ToString ( ) ;
156173 tutorialJson = null ;
157174 }
158175
159- //各ページのデータを読み込む
160- foreach ( var p in tutorialJson . pages )
161- {
162- tutorialPages . Add ( p . name , p ) ;
163- if ( tutorialJson . debug )
164- {
165- Debug . Log ( p ) ;
166- }
167- }
168-
169176 //バージョンチェック(失敗したら失敗ページに飛ばす)
170177 if ( check )
171178 {
0 commit comments