Skip to content

Commit a22049e

Browse files
committed
Support Get-UnitySetupInstance for Linux
1 parent d2cbd09 commit a22049e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) Microsoft Corporation. All rights reserved.
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33
Import-Module powershell-yaml -MinimumVersion '0.3' -ErrorAction Stop
44

@@ -77,8 +77,15 @@ class UnitySetupInstance {
7777
}
7878
([OperatingSystem]::Linux) {
7979
$this.Components = [UnitySetupComponent]::Linux
80-
81-
throw "UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!";
80+
$playbackEnginePath = [io.path]::Combine("$Path", "Data/PlaybackEngines");
81+
@{
82+
[UnitySetupComponent]::Documentation = , [io.path]::Combine("$Path", "Documentation");
83+
[UnitySetupComponent]::StandardAssets = , [io.path]::Combine("$Path", "Standard Assets");
84+
[UnitySetupComponent]::Mac_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "MacStandaloneSupport/Variations/macosx64_development_il2cpp");
85+
[UnitySetupComponent]::Windows = , [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport");
86+
[UnitySetupComponent]::Linux = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport/Variations/linux64_headless_development_mono");
87+
[UnitySetupComponent]::Linux_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport/Variations/linux64_headless_development_il2cpp");
88+
}
8289
}
8390
([OperatingSystem]::Mac) {
8491
$this.Components = [UnitySetupComponent]::Mac
@@ -286,7 +293,11 @@ function Get-UnityEditor {
286293
}
287294
}
288295
([OperatingSystem]::Linux) {
289-
throw "Get-UnityEditor has not been implemented on the Linux platform. Contributions welcomed!";
296+
$editor = Join-Path "$p" 'Editor/Unity'
297+
298+
if (Test-Path $editor) {
299+
Write-Output (Resolve-Path $editor).Path
300+
}
290301
}
291302
([OperatingSystem]::Mac) {
292303
$editor = Join-Path "$p" "Unity.app/Contents/MacOS/Unity"
@@ -1196,7 +1207,9 @@ function Get-UnitySetupInstance {
11961207
}
11971208
}
11981209
([OperatingSystem]::Linux) {
1199-
throw "Get-UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!";
1210+
if (-not $BasePath) {
1211+
$BasePath = @('~/Unity/Hub/Editor/*')
1212+
}
12001213
}
12011214
([OperatingSystem]::Mac) {
12021215
if (-not $BasePath) {

0 commit comments

Comments
 (0)