Unity Build Tool: Difference between revisions

From LD Smith Games Workshop
Jump to navigation Jump to search
No edit summary
Line 21: Line 21:


> gem install fileutils
> gem install fileutils
Edit settings unity_version.config to match your Unity settings
* PROJECTS_DIR - where the Unity projects are located
* UNITY_CURRENT_VERSION - the current version of Unity.  Previously auto-detected, but was broken with the new Unity hub.  Need to determine if there is a new way to get the Unity version
* PLAYMAKER_CURRENT_VERSION - current version of PlayMaker
* UNITY_EXE - location of the main Unity executable
* SCAN_PROJECTS_ON_STARTUP - loads project listing on startup.  Set this to false to speed startup





Revision as of 20:29, 30 June 2019

Instructions for the Unity Build Tool

Installation

The latest Unity Build Tool can be downloaded at https://bitbucket.org/gatechgrad/unityhelper/src/default/

Download and install Ruby if you don't already have it.

https://www.ruby-lang.org/en/

Navigate to the UnityHelper directory and run:

> ruby unity_version_gui.rb

Install the following gems

> gem install gtk3

> get install rubyzip

> gem install win32-sound

> gem install fileutils


Edit settings unity_version.config to match your Unity settings

  • PROJECTS_DIR - where the Unity projects are located
  • UNITY_CURRENT_VERSION - the current version of Unity. Previously auto-detected, but was broken with the new Unity hub. Need to determine if there is a new way to get the Unity version
  • PLAYMAKER_CURRENT_VERSION - current version of PlayMaker
  • UNITY_EXE - location of the main Unity executable
  • SCAN_PROJECTS_ON_STARTUP - loads project listing on startup. Set this to false to speed startup


Unitybuildtool 20190630.jpg

Compile Selected

Check the checkboxes to compile for the selected platforms

  • Windows - make Windows build
  • Mac - make MacOS build
  • Linux - make Linux build
  • Make ZIP files - ZIPs all folders in the build folder

Scan Projects

Reloads the main project list. Called when the Unity Build Tool is started.

Find Unity Scenes

For the selected projects, display all .unity files anywhere in the project folder

Clear build folder

Delete all files in the "build" folder for the selected projects

Open build folder

Open the "build" folder in Windows Explorer for each selected project

Clear VS files

Delete all .csproj and .sln files in the main project directory for each selected project. Useful for cleaning up old legacy Visual Studio project files that are no longer needed.

Remove Default Packages

Attempts to remove the default packages installed by Unity.

  • com.unity.textmeshpro
  • com.unity.ads
  • com.unity.analytics
  • com.unity.purchasing
  • com.unity.collab-proxy
  • com.unity.multiplayer-hlapi
  • com.unity.timeline
  • com.unity.xr.legacyinputhelper

Adds PackageRemover.cs to the Editor folder, and calls PackageRemover.RemovePackages.

Due to a domain/locking error that is thrown during removal, this call will fail when run from the Unity Build Tool, but it should work by selecting Build > Package Remover in the project.

Note - The removal will fail if there are errors related to TextMeshPro needing to be .NET 4.0 scripting. Set scripting in PlayerSettings to 4.0 before running RemovePackages.

Possible enhancement - make selectable list of packages

Update API

This will update the selected projects to the current Unity version, without prompting for each selected project.

Calls the following by command line

<unity executable> -accept-apiupdate -batchmode -quit -projectPath <project path>

Copy Scripts

Copies AutoSave.cs and PackageRemover.cs to Editor folder

Copies splash_background.jpg and splash_logo.jpg to the Assets/Sprites/SplashScreen folder. Still have to manually convert the images files to 2D/UI, and assign them under player settings. May be possible to automate this.

May want to remove PackageRemover.cs, since it's already copied in Remove Default Packages

Make Upload Script

Makes Windows batch file (butler_push_all.bat) to upload builds to Itch.io. Prompts for Itch.io identifier for each selected project.

Requires butler.bat in ..\..\tools\butler.bat.

 butler.bat
 C:\Users\<username>\AppData\Roaming\itch\broth\butler\versions\<itch_version>\butler %*