|
|
2 月之前 | |
|---|---|---|
| .. | ||
| .config | 2 月之前 | |
| .vscode | 2 月之前 | |
| Core | 2 月之前 | |
| Platforms | 2 月之前 | |
| Particle3DSample.sln | 2 月之前 | |
| README.md | 2 月之前 | |
This is a modernized version of the MonoGame Particle3D sample, demonstrating advanced 3D particle effects using MonoGame 3.8.4 framework.
The Particle3D Sample showcases various particle systems including:
The project demonstrates how to create custom particle effects using vertex buffers, custom shaders, and particle settings that can be configured via XML files.
This modernized version supports the following platforms using .NET 8.0:
.vscode/tasks.json and .vscode/launch.json)./Core - Shared game and particle system code/Platforms/Windows - Windows-specific entry point and project/Platforms/Desktop - DesktopGL (OpenGL) entry point and project/Platforms/Android - Android entry point and project/Platforms/iOS - iOS entry point and projectAll platform projects reference /Core for shared logic. Platform-specific code and entry points are separated to minimize #if/#endif usage.
dotnet build Platforms/Windows/Particle3DSample.Windows.csproj
dotnet run --project Platforms/Windows/Particle3DSample.Windows.csproj
dotnet build Platforms/Desktop/Particle3DSample.DesktopGL.csproj
dotnet run --project Platforms/Desktop/Particle3DSample.DesktopGL.csproj
dotnet build Platforms/Android/Particle3DSample.Android.csproj
dotnet run --project Platforms/Android/Particle3DSample.Android.csproj
dotnet build Platforms/iOS/Particle3DSample.iOS.csproj
dotnet run --project Platforms/iOS/Particle3DSample.iOS.csproj
.vscode/tasks.json and .vscode/launch.json)./Core - Shared game and particle system code/Platforms/Windows - Windows-specific entry point and project/Platforms/Desktop - DesktopGL (OpenGL) entry point and project/Platforms/Android - Android entry point and project/Platforms/iOS - iOS entry point and projectAll platform projects reference /Core for shared logic. Platform-specific code and entry points are separated to minimize #if/#endif usage.
dotnet build Particle3DSample.DesktopGL.csproj
dotnet run --project Particle3DSample.DesktopGL.csproj
#### Android
bash dotnet build Particle3DSample.Android.csproj
dotnet build Particle3DSample.Android.csproj -t:Run
### Using Visual Studio Code
1. Open the project folder in VS Code
2. Use the integrated terminal or Command Palette
3. Run tasks:
- `Ctrl+Shift+P` → "Tasks: Run Task"
- Select "build-windows", "build-desktopgl", or "build-android"
- Or use "run-windows" or "run-desktopgl" to build and run
#### Available VS Code Tasks
- `build-windows` - Build Windows version
- `build-desktopgl` - Build DesktopGL version
- `build-android` - Build Android version
- `run-windows` - Build and run Windows version
- `run-desktopgl` - Build and run DesktopGL version
- `clean-all` - Clean all projects
- `restore-all` - Restore NuGet packages
## Controls
- **Mouse** - Look around
- **Left Click** - Fire projectiles with particle trails
- **Right Click** - Create explosion effects
- **WASD** - Move camera
- **Space/Shift** - Move up/down
- **Escape** - Exit application
## Technical Details
### Modern .NET Features
- Uses SDK-style project files for simplified configuration
- Targets .NET 8.0 for best performance and modern language features
- Uses MonoGame 3.8.* NuGet packages instead of project references
- Nullable reference types enabled for better code safety
### Content Pipeline
The project uses pre-built .xnb content files located in the `Content/` directory:
- Particle textures (explosion.xnb, fire.xnb, smoke.xnb)
- Particle settings XML files and compiled .xnb versions
- Font files for UI text
- 3D model files
### Particle System Features
- Custom vertex structures optimized for particle rendering
- Hardware-accelerated particle rendering using vertex buffers
- XML-based particle system configuration
- Multiple particle emitter types
- Physics-based particle movement and effects
## Troubleshooting
### Common Issues
1. **Missing MonoGame Dependencies**
bash dotnet restore ```
Content not found errors
Graphics/Shader Issues
Android Build Issues
dotnet workload install androidThis is a sample project demonstrating MonoGame 3.8 features. Feel free to use it as a reference for your own particle system implementations.
This sample is provided as-is for educational and reference purposes.