C# plugin for Unreal Engine 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
pixeltris 8f0205cd86 Updated to 4.23 6 years ago
Config Restructure folders 7 years ago
Managed Updated to 4.23 6 years ago
Resources Restructure folders 7 years ago
Settings Support for latent actions (UGameplayTask, UOnlineBlueprintCallProxyBase, UBlueprintAsyncActionBase) 6 years ago
Source Updated to 4.23 6 years ago
Templates Enforce stricter naming similar to C++ (F,U,A,I prefixes) 6 years ago
.gitignore -add managed solution template 7 years ago
LICENSE Create LICENSE 6 years ago
README.md Updated to 4.23 6 years ago
USharp.uplugin Interop for online session functions 6 years ago

README.md

USharp

USharp is a plugin for Unreal Engine (4.23) which allows for programming in C#.

This project adapts various parts of mono-ue https://mono-ue.github.io/ and is roughly similar but has support for Mono, .NET Framework and .NET Core. The C++ code used is mostly PInvoke methods and the equivalent mono-ue backend code is mostly written in C#.

This project currently isn't usable for most use cases. There are a lot of bugs and lacking features. Check back soon for updates!

Join the gitter chat room for quick help / discussion https://gitter.im/USharp/Lobby

Features

  • Write C# using UObject exposed types (AActor, AGameMode, UActorComponent, etc). Define new UObject types and inherit existing ones. Exposed C# types can then be used in (or extended by) Blueprint.
  • Access to Unreal's reflection system (UClass, UFunction, UProperty, etc).
  • Hotreload
  • Dynamically switch between .NET Framework, .NET Core and Mono for an improved debugging / runtime experience without having to reopen the editor
  • Supports Windows, Mac and Linux

Plugin Setup

See the wiki on how to setup the plugin

Issues / caveats

  • This project depends on a lot of PInvoked functions which could potentially behave differently on different C++ compilers. This project may not work on some target platforms.
  • Like mono-ue this project depends on lots of generated code and IL weaving. It probably isn't the best for performance and there is a huge amount of generated code everywhere.
  • The weaved IL currently seems to break edit-and-continue debugging (issue with cecil?)
  • There is currently too much marshaling on structs / collections (list, map, set). Marshaling needs to be redesigned to avoid copies of entire collections / structs on trivial calls between C# / native code. Additionally marshaling of delegates needs to be redesigned (various issues such as being referenced as a copy of the delegate).

Why does this project exist? Why wasn't this instead contributions to mono-ue? Originally this project was just a way to access the UObject system from C# and ended up basically being a copy of mono-ue. The mono-ue compile times / debugging process made it hard to contribute starting with little knowledge of Unreal.