Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Generating wrappers for Cpp game code

pixeltris edited this page Jun 4, 2019 · 4 revisions

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:

  1. In the UE4 command box you can type USharpGen module TheNameOfThePlugin, followed by USharpGen compile.
  2. Add the module name to the module whitelist. Then regenerate the modules using UE4 command box command USharpGen modules, followed by USharpGen 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).