File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
package/com.unity.formats.usd/Samples/HelloUsd Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ using UnityEditor ;
1516using UnityEngine ;
1617using USD . NET ;
1718
@@ -29,8 +30,14 @@ class MyCustomData : SampleBase
2930
3031 void Start ( )
3132 {
33+ #if UNITY_EDITOR
34+ FocusConsoleWindow ( ) ;
35+ #endif
36+
3237 InitUsd . Initialize ( ) ;
38+ Debug . Log ( "=-=-=-=-=-= Starting HelloUsd Test Example =-=-=-=-=-=" ) ;
3339 Test ( ) ;
40+ Debug . Log ( "=-=-=-=-=-= HelloUsd Test Example Finished =-=-=-=-=-=" ) ;
3441 }
3542
3643 void Test ( )
@@ -67,5 +74,25 @@ void Test()
6774
6875 scene . Close ( ) ;
6976 }
77+
78+ private static EditorWindow GetConsoleWindow ( )
79+ {
80+ var editorWindowTypes = TypeCache . GetTypesDerivedFrom < EditorWindow > ( ) ;
81+ foreach ( var type in editorWindowTypes )
82+ {
83+ if ( type . Name == "ConsoleWindow" )
84+ {
85+ return EditorWindow . GetWindow ( type ) ;
86+ }
87+ }
88+
89+ throw new System . Exception ( "Error could not find ConsoleWindow type" ) ;
90+ }
91+
92+ public static void FocusConsoleWindow ( )
93+ {
94+ var consoleWindow = GetConsoleWindow ( ) ;
95+ consoleWindow . Focus ( ) ;
96+ }
7097 }
7198}
You can’t perform that action at this time.
0 commit comments