From 7aaee15853c1fcf73d8b475c2b6d5378e06dde76 Mon Sep 17 00:00:00 2001 From: jossanta Date: Thu, 9 Jun 2022 14:07:47 +0100 Subject: [PATCH 1/2] Add unity accelerator parameters --- UnitySetup/UnitySetup.psm1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 0652331..4789781 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -1761,7 +1761,15 @@ function Start-UnityEditor { [parameter(Mandatory = $false)] [switch]$Wait, [parameter(Mandatory = $false)] - [switch]$PassThru + [switch]$PassThru, + [parameter(Mandatory = $false)] + [string]$CacheServerEndpoint, + [parameter(Mandatory = $false)] + [string]$CacheServerNamespacePrefix, + [parameter(Mandatory = $false)] + [switch]$CacheServerDisableDownload, + [parameter(Mandatory = $false)] + [switch]$CacheServerDisableUpload ) process { switch -wildcard ( $PSCmdlet.ParameterSetName ) { @@ -1855,6 +1863,14 @@ function Start-UnityEditor { if ( $RunTests ) { $sharedArgs += '-runTests' } if ( $ForceFree) { $sharedArgs += '-force-free' } if ( $AdditionalArguments) { $sharedArgs += $AdditionalArguments } + if ( $CacheServerEndpoint) { + $sharedArgs += "-cacheServerEndpoint", $CacheServerEndpoint + $sharedArgs += "-adb2" + $sharedArgs += "-enableCacheServer" + if ( $CacheServerNamespacePrefix) { $sharedArgs += "-cacheServerNamespacePrefix", $CacheServerNamespacePrefix} + $sharedArgs += "-cacheServerEnableDownload", $(If ($CacheServerDisableDownload) {"false"} Else {"true"}) + $sharedArgs += "-cacheServerEnableUpload", $(If ($CacheServerDisableUpload) {"false"} Else {"true"}) + } [string[][]]$instanceArgs = @() foreach ( $p in $projectInstances ) { From 4d1487c37eaa63e21d04242a0e309c1649a815fe Mon Sep 17 00:00:00 2001 From: jossanta Date: Fri, 10 Jun 2022 12:32:08 +0100 Subject: [PATCH 2/2] Adding some docs and examples --- README.md | 8 ++++++++ UnitySetup/UnitySetup.psm1 | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index c7c527b..9471d28 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,14 @@ Start-UnityEditor -Project .\MyUnityProject Start-UnityEditor -Project .\MyUnityProject -Latest Start-UnityEditor -Project .\MyUnityProject -Version '2017.3.0f3' ``` + +Using the [Unity Accelerator](https://docs.unity3d.com/2019.3/Documentation/Manual/UnityAccelerator.html): +```powershell +Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23 +Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23:2523 -CacheServerNamespacePrefix "dev" +Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23 -CacheServerNamespacePrefix "dev" -CacheServerDisableDownload +Start-UnityEditor -Project .\MyUnityProject -CacheServerEndpoint 192.168.0.23 -CacheServerDisableUpload +``` Launch many projects at the same time: ```powershell Get-UnityProjectInstance -Recurse | Start-UnityEditor diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 4789781..a7cb3c8 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -1678,6 +1678,14 @@ function Test-UnityProjectInstanceMetaFileIntegrity { Should the Unity Editor quit after it's done? .PARAMETER Wait Should the command wait for the Unity Editor to exit? +.PARAMETER CacheServerEndpoint + 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. +.PARAMETER CacheServerNamespacePrefix + Set the namespace prefix. Used to group data together on the cache server. +.PARAMETER CacheServerDisableDownload + Disable downloading from the cache server. If ommited, the default value is true (download enabled) +.PARAMETER CacheServerDisableUpload + Disable uploading to the cache server. If ommited, the default value is true (upload enabled) .EXAMPLE Start-UnityEditor .EXAMPLE