Generating wrappers for Cpp game code - pixeltris/USharp GitHub Wiki
Generate C# wrappers for C++ game code
In the UE4 command box type USharpGen game
A new C# project file should have been added to your sln called YourProjectName.Native
. This contains bindings for anything publicly exposed to UE4 from your C++ game code (via UFUNCTION, UPROPERTY, etc). You need to run this command every time you want to update the C# wrapper code.
Generate C# wrappers for C++ game plugins
In the UE4 command box type USharpGen gameplugins
Generate C# wrappers for C++ engine plugins
There are a couple of ways to generate wrappers for engine plugins which weren't already handled when setting up USharp:
- In the UE4 command box you can type
USharpGen module TheNameOfThePlugin
, followed byUSharpGen compile
. - Add the module name to the module whitelist. Then regenerate the modules using UE4 command box command
USharpGen modules
, followed byUSharpGen compile
. You can alternatively delete the folder under/Plugins/USharp/Binaries/Managed/Modules/
and reopen the editor (which will regenerate the modules based on the whitelist file).