Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 25 additions & 1 deletion UnitySetup/UnitySetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1761,7 +1769,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
Comment on lines +1773 to +1780

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a description of these parameters in the function header comment? perhaps even example?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example in the readme would be great!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestions, I agree it's much clearer now with the examples.

)
process {
switch -wildcard ( $PSCmdlet.ParameterSetName ) {
Expand Down Expand Up @@ -1855,6 +1871,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 ) {
Expand Down