Comments (10)
你试试先加载了子类,然后再mixin父类?
from puerts.
我多测试了几次 ,感觉跟编辑器启动的加载顺序有关 ,跟代码里的类加载顺序关系不大,多重启几次编辑器有的时候调用父类就可以生效,但是调用生效的时候不关闭编辑器,PIE第二次会卡死。
from puerts.
多次重启工程,有时候调用父类生效了,但是再次PIE直接卡死
卡死的时候应该是调用到父类ReceiveBeginPlay的时候,父类子类的ReceiveBeginPlay都没有打印出来 ,testfunction都执行成功
from puerts.
from puerts.
提交了一个demo分支
https://github.com/lzj10/puerts_unreal_demo/tree/test_mixin
from puerts.
感觉第二次PIE启动的时候子类ReceieveBeginPlay的SuperStruct和父类的ReceieveBeginPlay的UFunction对象地址不同,TestFunction是一致的
from puerts.
我没重现调用不到的情况。
倒是卡死是100%重现的。
卡死的原因倒是找到了:你给的demo,TestActor没有BeginPlay,你先mixin TestActor会导致TestActor添加BeginPlay,然后加载TestActor_Child会产生对TestActor添加BeginPlay的引用,然后停止播放后,被mixin的类都有一个restore行为,会把添加的方法删除,于是TestActor_Child引用了一个已经被删除的UFunction实例。
暂时的规避方法:你手动在TestActor添加一个空的BeginPlay重载。
from puerts.
你如果先加载了子类然后再mixin,子类调用基类将触发不了TestActor没有BeginPlay。因为对基类的调用已经定向到Actor那了。这应该是你偶尔不触发的原因。
from puerts.
收到 感谢~
from puerts.
我把卡死解决掉。不过如果TestActor没有BeginPlay的话,仍然根据加载顺序不一样会出现不触发的可能。然后通过文档约束下。
from puerts.
Related Issues (20)
- [UE] Bug: TS对UE原生容器for of迭代的异常表现?似乎是局部变量被提前GC了 HOT 11
- [Unity] Bug: 建议PathHelper加上[UnityEngine.Scripting.Preserve] HOT 1
- [UE] Question: Mixin 可以扩展蓝图类的原有函数吗? HOT 2
- [UE] esm module两次读文件的问题
- [Unity] Bug: 2022.3.14f1+xll2cpp打安卓包报错:duplicate symbol: pesapi_add_return HOT 2
- 关于文档的一些建议或者意见 HOT 15
- [UE] 我想问一下关于 V8 GC 埋点的问题? HOT 3
- [Unity] Bug: unity 最新版本还是2.0.5
- [Unity] Bug: JS派生C#类后,super 访问异常 HOT 1
- [Unity] Bug: 过滤掉构造函数.ctor后,仍然生成了Constructor绑定函数
- [UE] 自动注册蓝图和脚本mixin的一个方案
- [UE] 我想咨询下一下关于 JIT 的问题 HOT 8
- [Unity] how to set color and create gameobject (discrepancies between editor and on-device)? HOT 4
- 【UE5】【讨论】继承引擎类功能实际使用体验以及和Mixin功能的对比
- [Unity] Bug: VisionOS Platform Support for Unity Plugin
- [Unity]/[UE] c++静态绑定,传参的各种情况不一致 HOT 8
- [UE] Bug: quickjs模式关闭时崩溃 HOT 4
- [Unity] Benchmark in readme for jint vs puerts HOT 1
- [UE] 关于 QuickJS 编译到 NS 平台的方法 HOT 2
- [Unity] 2023 unity支持wasmbigint 开启后puerts无法初始化 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puerts.