Skip to content

Commit 727c9e8

Browse files
committed
Support for Components on UnitySetupInstance
1 parent 45b666f commit 727c9e8

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ enum UnitySetupComponentType
1919
Mac = (1 -shl 11)
2020
Vuforia = (1 -shl 12)
2121
WebGL = (1 -shl 13)
22-
All = (-1)
22+
All = (1 -shl 14) - 1
2323
}
2424

2525
class UnitySetupInstaller
@@ -34,8 +34,9 @@ class UnitySetupInstaller
3434
class UnitySetupInstance
3535
{
3636
[UnityVersion]$Version
37+
[UnitySetupComponentType]$Components
3738
[string]$Path
38-
39+
3940
UnitySetupInstance([string]$path) {
4041

4142
$ivyPath = [io.path]::Combine("$path", 'Data\UnityExtensions\Unity\Networking\ivy.xml');
@@ -44,10 +45,37 @@ class UnitySetupInstance
4445

4546
if( !($xmlDoc.'ivy-module'.info.unityVersion)) {
4647
throw "Unity setup ivy is missing version: $ivyPath"
47-
}
48+
}
4849

4950
$this.Path = $path
5051
$this.Version = $xmlDoc.'ivy-module'.info.unityVersion
52+
$this.Components = [UnitySetupComponentType]::Setup
53+
54+
$componentTests = @{
55+
[UnitySetupComponentType]::Documentation = ,"$Path\Data\Documentation";
56+
[UnitySetupComponentType]::StandardAssets = ,"$Path\Standard Assets";
57+
[UnitySetupComponentType]::Windows_IL2CPP = ,"$Path\Data\PlaybackEngines\windowsstandalonesupport\Variations\win32_development_il2cpp";
58+
[UnitySetupComponentType]::Metro = "$Path\Data\PlaybackEngines\MetroSupport\Templates\UWP_.NET_D3D",
59+
"$Path\Data\PlaybackEngines\MetroSupport\Templates\UWP_D3D";
60+
[UnitySetupComponentType]::UWP_IL2CPP = ,"$Path\Data\PlaybackEngines\MetroSupport\Templates\UWP_IL2CPP_D3D";
61+
[UnitySetupComponentType]::Android = ,"$Path\Data\PlaybackEngines\AndroidPlayer";
62+
[UnitySetupComponentType]::iOS = , "$Path\Data\PlaybackEngines\iOSSupport";
63+
[UnitySetupComponentType]::AppleTV = , "$Path\Data\PlaybackEngines\AppleTVSupport";
64+
[UnitySetupComponentType]::Facebook = , "$Path\Data\PlaybackEngines\Facebook";
65+
[UnitySetupComponentType]::Linux = , "$Path\Data\PlaybackEngines\LinuxStandaloneSupport";
66+
[UnitySetupComponentType]::Mac = , "$Path\Data\PlaybackEngines\MacStandaloneSupport";
67+
[UnitySetupComponentType]::Vuforia = , "$Path\Data\PlaybackEngines\VuforiaSupport";
68+
[UnitySetupComponentType]::WebGL = , "$Path\Data\PlaybackEngines\WebGLSupport";
69+
}
70+
71+
$componentTests.Keys | ForEach-Object {
72+
foreach( $test in $componentTests[$_] ) {
73+
if( Test-Path -PathType Container -Path $test ) {
74+
$this.Components += $_
75+
break;
76+
}
77+
}
78+
}
5179
}
5280
}
5381

0 commit comments

Comments
 (0)