This is a custom Unity WebGL template designed specifically for the MG Car Configurator project. It provides a professional, branded interface with optimized performance and user experience.
- Custom MG logo integration (white and red variants)
- Brand-consistent color scheme (MG Red #D32F2F, Black #1A1A1A)
- Professional typography using Inter font family
- Responsive design for all devices
- Progressive loading with branded loading screen
- Adaptive quality settings modal
- Mobile-optimized touch controls
- Performance monitoring and analytics
- Memory-efficient asset loading
- Keyboard Shortcuts:
1-7
: Quick material switchingR
: Reset camera positionF
: Toggle fullscreen mode
- Mouse Controls:
- Mouse wheel: Zoom in/out
- Right-click drag: Pan camera
- Left-click drag: Orbit camera
- Touch Controls:
- Single finger: Orbit camera
- Two fingers: Pan and zoom
- Ultra: Maximum quality for high-end desktops
- High: Balanced quality for standard desktops
- Medium: Optimized for tablets and mid-range devices
- Low: Performance mode for mobile and weak devices
-
Copy Template: The template is already installed in
Assets/WebGLTemplates/MG-Configurator/
-
Select Template in Unity:
- Go to
File > Build Settings
- Select
WebGL
platform - Click
Player Settings
- Under
Publishing Settings
, setWebGL Template
toMG-Configurator
- Go to
-
Build Project:
- Choose your build folder
- Click
Build
orBuild and Run
Assets/WebGLTemplates/MG-Configurator/
├── index.html # Main template file with Unity integration
├── TemplateData/
│ ├── style.css # MG-branded styles and responsive design
│ ├── mg-logo-white.png # MG logo for header
│ ├── mg-logo-red.png # MG logo for loading screen
│ └── favicon.ico # Website favicon
└── README.md # This documentation
Edit the CSS variables in TemplateData/style.css
:
:root {
--mg-red: #D32F2F; /* Primary MG red */
--mg-dark-red: #B71C1C; /* Darker red for hover states */
--mg-black: #1A1A1A; /* Primary dark color */
--mg-white: #FFFFFF; /* Primary light color */
--mg-gold: #FFD700; /* Accent color for progress bars */
}
Modify the loadingTips
array in index.html
:
var loadingTips = [
"💡 Use mouse wheel to zoom, right-click to pan",
"🎨 Press 1-7 to quickly change materials",
// Add your custom tips here
];
The template automatically integrates with your Unity scripts:
CarMaterialSwapper.cs
- Material switching functionalityCameraOrbit.cs
- Camera control systemQualitySettings
- Graphics quality management
- ✅ Chrome 80+
- ✅ Firefox 75+
- ✅ Safari 13+
- ✅ Edge 80+
- ✅ iOS Safari 13+
- ✅ Android Chrome 80+
- ✅ Samsung Internet 12+
- Texture Optimization: Use compressed textures (DXT5/BC7 for desktop, ASTC for mobile)
- Model Optimization: Keep polygon count under 50k triangles
- Memory Settings: Use 64MB initial, 1024MB maximum WebGL memory
- Compression: Enable Brotli compression in Unity build settings
- Ultra (0): Full quality, all effects enabled
- High (1): High quality with reduced shadows
- Medium (2): Balanced quality, some effects disabled
- Low (3): Performance mode, minimal effects
Template not showing in Unity:
- Ensure the template folder is in
Assets/WebGLTemplates/
- Restart Unity Editor
- Check that all files are present
Loading errors:
- Verify Unity build files are in the correct
Build/
folder - Check browser console for specific error messages
- Ensure all template assets are properly copied
Performance issues:
- Lower the quality setting using the in-app modal
- Check that textures are properly compressed
- Monitor memory usage in browser dev tools
- Build your Unity project to a local folder
- Serve the files using a local web server (not file:// protocol)
- Test on multiple devices and browsers
- Upload all build files to your web server
- Ensure proper MIME types for
.wasm
and.data
files - Enable compression (Gzip/Brotli) on your server
- Test loading performance and functionality
For issues specific to this template:
- Check the browser console for error messages
- Verify Unity WebGL build settings match recommendations
- Test with a fresh Unity WebGL build
- Ensure all MG logo assets are properly copied
- v1.0 - Initial MG-branded template with full feature set
- Responsive design and mobile optimization
- Quality settings modal and keyboard shortcuts
- Performance monitoring and error handling