Skip to content

Commit 1845a9f

Browse files
authored
Merge pull request #235 from santanor/develop
Add unity accelerator parameters
2 parents 4c4041a + 4d1487c commit 1845a9f

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ Start-UnityEditor -Project .\MyUnityProject
6767
Start-UnityEditor -Project .\MyUnityProject -Latest
6868
Start-UnityEditor -Project .\MyUnityProject -Version '2017.3.0f3'
6969
```
70+
71+
Using the [Unity Accelerator](https://docs.unity3d.com/2019.3/Documentation/Manual/UnityAccelerator.html):
72+
```powershell
73+
Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23
74+
Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23:2523 -CacheServerNamespacePrefix "dev"
75+
Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23 -CacheServerNamespacePrefix "dev" -CacheServerDisableDownload
76+
Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23 -CacheServerDisableUpload
77+
```
7078
Launch many projects at the same time:
7179
```powershell
7280
Get-UnityProjectInstance -Recurse | Start-UnityEditor

UnitySetup/UnitySetup.psm1

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,14 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
16781678
Should the Unity Editor quit after it's done?
16791679
.PARAMETER Wait
16801680
Should the command wait for the Unity Editor to exit?
1681+
.PARAMETER CacheServerEndpoint
1682+
If included, the editor will attempt to use a Unity Accelerator hosted in the provided IP. The endpoint should be in the format of [IP]:[Port]. If the default Accelerator port is used, at the time of writing this, the port should be ommited.
1683+
.PARAMETER CacheServerNamespacePrefix
1684+
Set the namespace prefix. Used to group data together on the cache server.
1685+
.PARAMETER CacheServerDisableDownload
1686+
Disable downloading from the cache server. If ommited, the default value is true (download enabled)
1687+
.PARAMETER CacheServerDisableUpload
1688+
Disable uploading to the cache server. If ommited, the default value is true (upload enabled)
16811689
.EXAMPLE
16821690
Start-UnityEditor
16831691
.EXAMPLE
@@ -1761,7 +1769,15 @@ function Start-UnityEditor {
17611769
[parameter(Mandatory = $false)]
17621770
[switch]$Wait,
17631771
[parameter(Mandatory = $false)]
1764-
[switch]$PassThru
1772+
[switch]$PassThru,
1773+
[parameter(Mandatory = $false)]
1774+
[string]$CacheServerEndpoint,
1775+
[parameter(Mandatory = $false)]
1776+
[string]$CacheServerNamespacePrefix,
1777+
[parameter(Mandatory = $false)]
1778+
[switch]$CacheServerDisableDownload,
1779+
[parameter(Mandatory = $false)]
1780+
[switch]$CacheServerDisableUpload
17651781
)
17661782
process {
17671783
switch -wildcard ( $PSCmdlet.ParameterSetName ) {
@@ -1855,6 +1871,14 @@ function Start-UnityEditor {
18551871
if ( $RunTests ) { $sharedArgs += '-runTests' }
18561872
if ( $ForceFree) { $sharedArgs += '-force-free' }
18571873
if ( $AdditionalArguments) { $sharedArgs += $AdditionalArguments }
1874+
if ( $CacheServerEndpoint) {
1875+
$sharedArgs += "-cacheServerEndpoint", $CacheServerEndpoint
1876+
$sharedArgs += "-adb2"
1877+
$sharedArgs += "-enableCacheServer"
1878+
if ( $CacheServerNamespacePrefix) { $sharedArgs += "-cacheServerNamespacePrefix", $CacheServerNamespacePrefix}
1879+
$sharedArgs += "-cacheServerEnableDownload", $(If ($CacheServerDisableDownload) {"false"} Else {"true"})
1880+
$sharedArgs += "-cacheServerEnableUpload", $(If ($CacheServerDisableUpload) {"false"} Else {"true"})
1881+
}
18581882

18591883
[string[][]]$instanceArgs = @()
18601884
foreach ( $p in $projectInstances ) {

0 commit comments

Comments
 (0)