A command-line tool for quickly initializing Unity projects with predefined templates and configurations. This tool extracts embedded Unity project templates to create a complete project structure with the correct version settings.
Unity Project Initializer creates a complete Unity project structure in the current directory by extracting embedded ZIP archives that contain predefined Unity project templates. Each template includes the necessary folders (Assets, Packages, ProjectSettings) and configuration files required for a specific Unity version.
The tool automatically:
- Creates the standard Unity project directory structure
- Extracts all necessary configuration files
- Sets up the correct Unity version metadata
- Provides suggestions for similar versions if the requested version is not found
unity-init -l
unity-init --listDisplays all Unity versions that are available as embedded templates.
unity-init -v <version>
unity-init --version <version>Creates a Unity project using the specified version template in the current directory.
Example:
unity-init -v 6000.1.12unity-init -h
unity-init --helpShows usage information and available commands.
To add support for new Unity versions, follow these steps:
- Create a complete Unity project with the desired version and settings
- Create a ZIP archive containing the following folders:
- Assets/
- Packages/
- ProjectSettings/
- Name the ZIP file using the Unity version format (e.g.,
6000.1.12.zip) - Place the ZIP file in the
UnityInitializer.Core/Source/directory - The file will be automatically included as an embedded resource during build
The embedded resources are configured in the Core project file:
<ItemGroup>
<EmbeddedResource Include="Source\*.zip" />
</ItemGroup>- Clone or download the project
- Navigate to the project root directory
- Make the installation script executable:
chmod +x install.sh
- Run the installation script:
./install.sh
The script will:
- Build the project in Release configuration
- Copy all necessary files to
/usr/local/lib/unity-init/ - Create a symbolic link in
/usr/local/bin/unity-init - Add the command to your system PATH
- Clone or download the project
- Open PowerShell as Administrator
- Navigate to the project root directory
- Run the installation script:
.\install.ps1
For forced reinstallation:
.\install.ps1 -ForceThe script will:
- Build the project in Release configuration
- Copy all necessary files to
C:\Program Files\UnityInit\ - Add the directory to system PATH
- Make the command available globally
Note: You may need to restart your command prompt or PowerShell session for PATH changes to take effect.
- .NET 9.0 or later
- Unity versions corresponding to the embedded templates
unity-project-initializer/
├── cll/
│ ├── UnityInitializer.sln
│ ├── UnityInitializer.Cli/ # Console application
│ │ └── UnityInitializer.Cli.csproj
│ └── UnityInitializer.Core/ # Core library
│ ├── Source/ # Embedded ZIP templates
│ │ └── 6000.1.12.zip
│ └── UnityInitializer.Core.csproj
├── install.sh # Linux installation script
├── install.ps1 # Windows installation script
└── README.md
Initialize a Unity 6000.1.12 project in the current directory:
cd /path/to/your/project
unity-init -v 6000.1.12List all available Unity versions:
unity-init -lIf you specify a version that doesn't exist, the tool will suggest similar available versions:
unity-init -v 6000
# Output: Unity version 6000 not found. Available versions: 6000.1.12, 6000.2.11