Skip to content

Commit 15f5b10

Browse files
committed
create unity assets fixes and improvements
1 parent ddcf639 commit 15f5b10

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

create_unity_asset.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Param (
1717
[Parameter(Mandatory=$true)][string]$unity_path,
1818
[Parameter(Mandatory=$false)][string]$input_asset,
1919
[Parameter(Mandatory=$false)][string]$package_name="Ros2ForUnity",
20-
[Parameter(Mandatory=$true)][string]$output_dir
20+
[Parameter(Mandatory=$false)][string]$output_dir
2121
)
2222

2323
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
@@ -27,9 +27,12 @@ if(-Not $PSBoundParameters.ContainsKey('input_asset')) {
2727
$input_asset= Join-Path -Path $scriptPath -ChildPath "\src\Ros2ForUnity"
2828
}
2929

30+
if(-Not $PSBoundParameters.ContainsKey('output_dir')) {
31+
$output_dir= Join-Path -Path $scriptPath -ChildPath "\install\unity_package"
32+
}
33+
3034
if(-Not (Test-Path -Path "$output_dir")) {
31-
Write-Host "Output dir doesn't exist!" -ForegroundColor red
32-
exit 1
35+
mkdir ${output_dir} | Out-Null
3336
}
3437

3538
& "$unity_path" -version | Tee-Object -Variable unity_version | Out-Null

create_unity_asset.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ display_usage() {
77
echo "This script creates a temporary Unity project in '/tmp' directory, copy input asset and makes an unity package out of it. Valid Unity license is required."
88
echo ""
99
echo "Usage:"
10-
echo "create_unity_asset.sh -u <UNITY_PATH> -i [INPUT_ASSET] -p [PACKAGE_NAME] -o <OUTPUT_DIR>"
10+
echo "create_unity_asset.sh -u <UNITY_PATH> -i [INPUT_ASSET] -p [PACKAGE_NAME] -o [OUTPUT_DIR]"
1111
echo ""
1212
echo "UNITY_PATH - Unity editor executable path"
13-
echo "INPUT_ASSET - input asset to pack into unity package, default = './src/Ros2ForUnity'"
13+
echo "INPUT_ASSET - input asset to pack into unity package, default = 'src/Ros2ForUnity'"
1414
echo "PACKAGE_NAME - unity package name, default = 'Ros2ForUnity'"
15-
echo "OUTPUT_DIR - output file directory"
15+
echo "OUTPUT_DIR - output file directory, default = 'install/unity_package'"
1616
}
1717

1818
UNITY_PATH=""

0 commit comments

Comments
 (0)