Comments (15)
我有一个LuaSvrProxy的gameobject,他有一个order execute是999,保证了luasvr是最后被析构的,不知道这个东西自己是不是有bug,unity不能保证luasvr最后被析构的话就会出现你说的问题。
from slua.
我测试了一下 在编辑器里 这个OnDestroy顺序确实是随机的.
mac Unity 5.2.0
有没有办法调用lua前加个检查?
from slua.
我试图merge了,结果发现有问题,又revert了,主要是out类型的参数还要考虑赋值。
from slua.
我测试了一下,使用MonoManager的Executetion Order 配置其他所有monobehavirou的数值都小于SLua.LuaSvrGameObject的9999就是可以的。
然后destory顺序是
from slua.
通过写程序应该可以便利所有monobehavirour设置其数值。
任何在onDestory里调用luastate里报错的MonoBehavirous都可以添加进入列表,保证其析构顺序先于LuaSvr.
from slua.
我这边测试OnDestroy还是随机的,不知道什么情况
执行顺序:
另一张,图片总是上传失败,不传了
from slua.
你试一下动态添加脚本 ,而不是事先在编辑器里绑定好
from slua.
我刚测试了下,如果脚本预先都在场景里绑定好了,则顺序是固定的。
否则如果是运行时通过AddComponent绑定上去的,则destroy顺序是随机的
from slua.
AddComponent绑定上去后,程序修改,添加进入这个列表不知道行不行?
from slua.
脚本都已经加到执行列表里了
from slua.
http://answers.unity3d.com/questions/1016015/order-of-destroy-objects-and-ondestroy-event.html
有看到类似的问题
from slua.
我现在把luasrvgameobject里 dispose luastate的代码注视掉了,等到进程结束自然释放
from slua.
OnApplicationQuit呢?
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationQuit.html
from slua.
也不行,我测试了
from slua.
去掉dispose 暂时应该只能这样了
from slua.
Related Issues (20)
- 加群
- 加群专用 HOT 3
- 用slua记载一个蓝图类报错
- Insecure Temporary File
- 加群 HOT 1
- 如何编译64位Lua5.3版本的slua HOT 3
- 1.6 升1.7后 android取UnityEngine.Time.deltaTime 取不到 是nil指
- slua clang 编译后 crash HOT 3
- 加群
- 加群
- 加群 HOT 1
- SLua的GetAlreadyDestroyedObjectNames
- 加群
- 加群
- .Net 6(Unity2021) EnableKeyword 的重载方法中增加了 in 关键字
- Unity2021.2, Unity2022.2 Lua桥生成错误
- 加群
- DllNotFoundException: Unable to load DLL 'slua'. Tried the load the following dynamic libraries HOT 1
- 加群
- 加群
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 slua.