Fixed unity task

This commit is contained in:
a.samsonkin 2022-05-31 15:08:31 +03:00
parent 07100f700d
commit 9ea2c02dc7
1 changed files with 3 additions and 2 deletions

View File

@ -5,14 +5,15 @@ use Exception;
task('unity', function() task('unity', function()
{ {
$unity_path = guess_unity_app_dir(); $unity_path = guess_unity_app_dir();
$proj_path = normalize_path(get("UNITY_ASSETS_DIR") . '/../');
if(is_win()) if(is_win())
{ {
$unity_app_path = "'$unity_path/Editor/Unity.exe'"; $unity_app_path = "'$unity_path/Editor/Unity.exe'";
run_background_proc($unity_app_path, ['-projectPath', '.']); run_background_proc($unity_app_path, ['-projectPath', $proj_path]);
} }
else else
{ {
$cmd = guess_unity_app_dir()."'Unity.app/Contents/MacOS/Unity' -projectPath . > /dev/null 2>&1&"; $cmd = guess_unity_app_dir()."'Unity.app/Contents/MacOS/Unity' -projectPath $proj_path > /dev/null 2>&1&";
system($cmd, $res); system($cmd, $res);
} }
}); });