game add
Add a Unity or Unreal Engine project to an existing Flutter application without creating a new plugin package.
Usage
game add engine <unity|unreal> [options]Subcommands
engine unity- Add Unity projectengine unreal- Add Unreal project
Options
| Option | Description | Default |
|---|---|---|
-t, --template | Project template: example or minimal | example |
-p, --path | Custom path for engine project | <engine>_project |
--update-config | Update or create .game.yml | true |
Examples
Add Unity Project
# Add with example template
game add engine unity
# Add with minimal template
game add engine unity --template minimal
# Add with custom path
game add engine unity --path my_unity_game
# Add without updating config
game add engine unity --no-update-configAdd Unreal Project
# Add Unreal with example template
game add engine unreal
# Add with custom path
game add engine unreal --path my_unreal_gameWhat It Does
The add engine command:
- Creates Engine Project - Adds Unity/Unreal project directory
- Copies Template - Uses example or minimal template
- Updates Configuration - Creates/updates
.game.yml - Adds Solution File - Includes
.slnfile for Unity (Visual Studio)
Templates
Example Template
Includes full-featured sample project:
- Complete demo scene/level
- Sample scripts with communication examples
- Working example with Game Framework integration
- Pre-configured for immediate use
Minimal Template
Creates basic starter project:
- Empty scene/level
- Essential scripts only
- Ready for customization
- Minimal setup
Example template is recommended for learning - it includes working examples of Flutter ↔ Engine communication!
Project Structure
After running game add engine unity:
my_flutter_app/
├── lib/
│ └── main.dart
├── unity_project/ # ← New Unity project
│ ├── Assets/
│ │ └── GameFramework/
│ │ └── Scripts/
│ ├── ProjectSettings/
│ ├── Packages/
│ └── MyGame.sln
├── .game.yml # ← New or updated config
├── pubspec.yaml
└── ...Configuration
The command creates/updates .game.yml:
name: my_flutter_app
version: 1.0.0
engines:
unity:
project_path: ./unity_project
export_path: ./unity_project/Exports
platforms:
android:
enabled: true
target_path: android/unityLibrary
ios:
enabled: true
target_path: ios/UnityFramework.frameworkUse Cases
Add to Existing Flutter App
Perfect for adding game content to an existing app:
cd your_existing_flutter_app
game add engine unityTest Game Engines
Create a test Flutter project to experiment with engines:
flutter create test_app
cd test_app
game add engine unity
game add engine unrealStart Fresh
Create a clean engine project for development:
flutter create my_game_app
cd my_game_app
game add engine unity --template minimalvs scaffold Command
Use game add engine when:
- Adding to existing Flutter app
- Want direct control over Flutter project
- Don't need a publishable plugin package
Use game scaffold when:
- Creating a publishable plugin package
- Want package structure with example app
- Planning to share/publish the package
Next Steps
After adding an engine:
- Open in Editor -
open unity_project/orunreal_project/ - Make Changes - Customize your game
- Export -
game export unity --platform android - Sync -
game sync unity --platform android - Run -
flutter run
Troubleshooting
Directory Already Exists
Error: unity_project directory already exists
Solutions:
- Use custom path:
--path my_custom_unity - Remove existing directory
- Specify different location
Template Download Failed
Error: Failed to download template
Solutions:
- Check internet connection
- Try again after a moment
- Use minimal template if example fails
- Check GitHub access
Configuration Conflict
Error: .game.yml already exists
Solutions:
- Manual merge configuration
- Use
--no-update-configto skip - Backup and allow overwrite
Related Commands
game scaffold- Create plugin packagegame export- Export gamegame sync- Sync filesgame init- Initialize configuration
Engine added successfully? Open it in Unity/Unreal Editor and start creating!