Haxe-UnrealEngine5
结论
- UE C++ header => External/**.hx
- .hx => .h/.cpp,和 UE C++ 一起编译
- 使用 hxcpp 来调试 .hx
good:
- 理论上不仅限反射代码
- 走 UE C++,无需维护 backend,比如 Lua Binding
- 理论上接近 UE C++ 的性能
bad:
- 没人维护,工作量仍然庞大,因为 UE C++ 太复杂了
- haxe IDE,Jetbrain 系的没找到,TODO
why:
- 不想写 C++,打开 IDE 工程非常重,IntelliSense 分析完要等很久,尤其是 Gameplay 希望一个接近的静态语言 Transpile 到 C++,做下分层
- 类似 Lua/Typescript/C# 带 VM 的语言,维护成本还是很高
结论是什么呢?
目前还是没有一款 ”理想“ 的脚本语言
想要借力,语言本身基建和 IDE 就要足够强大,任何一个点都是个人难以承担的维护成本
Haxe Pipeline
Haxe 相比于其他脚本方案的区别在于,直接 Transpile 到 C++,额外带一份 HaxeLib 的 C++ 版本,作为 UE C++ 代码一起编译

.hx

.h

.cpp

Setup
说下坑点:master 跑不了,要拷贝下文件
UE5.0.3
git clone https://github.com/SomeRanDev/Haxe-UnrealEngine5.git
git checkout version-1.0-(hxcpp)
Extern/ 里所有 .hx 要拷贝到工程 src/ue 目录下,不带文件夹


然后
1) Compile HxCpp Static Lib
cd Haxe/HaxeStaticLib
haxe compile.hxml
2) Compile Main Project Haxe
cd Haxe
haxe compile.hxml
3) Open/Compile UE Project
- Simply hit the compile button in Unreal and you’re good to go!