55using System . Collections . Generic ;
66using System . Linq ;
77using Ecsact . Editor ;
8+ using UnityEngine . Rendering ;
89
910#nullable enable
1011
@@ -129,8 +130,7 @@ public static void Build(Options options) {
129130
130131 _rtSettings = EcsactRuntimeSettings . Get ( ) ;
131132
132- string runtimeBuilderExecutablePath =
133- EcsactSdk . FindExecutable ( "ecsact_rtb" ) ;
133+ string runtimeBuilderExecutablePath = EcsactSdk . FindExecutable ( "ecsact" ) ;
134134
135135 var progressId = Progress . Start ( "Ecsact Runtime Builder" ) ;
136136
@@ -139,7 +139,7 @@ public static void Build(Options options) {
139139 proc . StartInfo . CreateNoWindow = true ;
140140 proc . StartInfo . WindowStyle = ProcessWindowStyle . Hidden ;
141141 proc . EnableRaisingEvents = true ;
142- proc . StartInfo . Arguments = "" ;
142+ proc . StartInfo . Arguments = "build " ;
143143 proc . StartInfo . RedirectStandardError = true ;
144144 proc . StartInfo . RedirectStandardOutput = true ;
145145 proc . StartInfo . UseShellExecute = false ;
@@ -262,13 +262,7 @@ public static void Build(Options options) {
262262 proc . StartInfo . Arguments += " --debug " ;
263263 }
264264
265- if ( _rtSettings . systemImplSource == Ecsact . SystemImplSource . WebAssembly ) {
266- proc . StartInfo . Arguments += " --wasm=wasmer " ;
267- } else if ( _rtSettings . systemImplSource == Ecsact . SystemImplSource . Csharp ) {
268- proc . StartInfo . Arguments += " --wasm=none " ;
269- }
270-
271- proc . StartInfo . Arguments += " --report_format=json " ;
265+ proc . StartInfo . Arguments += " --format=json " ;
272266
273267 proc . StartInfo . Arguments += "--output=\" " ;
274268 proc . StartInfo . Arguments +=
@@ -301,6 +295,30 @@ public static void Build(Options options) {
301295 Path . GetFullPath ( FileUtil . GetUniqueTempPathInProject ( ) ) ;
302296 }
303297
298+ proc . StartInfo . Arguments += " " ;
299+ proc . StartInfo . Arguments += "--recipe=\" " ;
300+
301+ if ( _settings . ecsactBuildEnabled ) {
302+ if ( ! string . IsNullOrEmpty ( _settings . recipePath ) ) {
303+ var recipeFullPath = Path . GetFullPath ( _settings . recipePath ) ;
304+ proc . StartInfo . Arguments += recipeFullPath ;
305+ proc . StartInfo . Arguments += "\" " ;
306+ } else {
307+ UnityEngine . Debug . LogError (
308+ "A recipe path hasn't been given in Ecsact Build Settings"
309+ ) ;
310+ }
311+ }
312+
313+ proc . Exited +=
314+ new System . EventHandler ( delegate ( object sender , System . EventArgs e ) {
315+ if ( proc . ExitCode != 0 ) {
316+ UnityEngine . Debug . Log ( "Ecsact build failed" ) ;
317+ } else {
318+ UnityEngine . Debug . Log ( "Ecsact build succeeded" ) ;
319+ }
320+ } ) ;
321+
304322 Progress . Report ( progressId , 0.1f ) ;
305323 proc . Start ( ) ;
306324 proc . BeginOutputReadLine ( ) ;
@@ -368,7 +386,7 @@ ModuleMethodsMessage message
368386 UnityEngine . Debug . LogWarning (
369387 $ "Old method '{ methodName } ' should be <color=red>removed</color> " +
370388 $ "from module <b>{ message . module_name } </b>. It no longer exists. " +
371- "(reported by ecsact_rtb )"
389+ "(reported by ecsact build )"
372390 ) ;
373391 }
374392 }
@@ -378,7 +396,7 @@ ModuleMethodsMessage message
378396 if ( ! methods . Contains ( methodName ) ) {
379397 UnityEngine . Debug . LogWarning (
380398 $ "New method '{ methodName } ' should be <color=green>added</color> " +
381- $ "to module <b>{ message . module_name } </b>. (reported by ecsact_rtb )"
399+ $ "to module <b>{ message . module_name } </b>. (reported by ecsact build )"
382400 ) ;
383401 }
384402 }
0 commit comments