Giter Club home page Giter Club logo

Comments (15)

pangweiwei avatar pangweiwei commented on August 18, 2024

我有一个LuaSvrProxy的gameobject,他有一个order execute是999,保证了luasvr是最后被析构的,不知道这个东西自己是不是有bug,unity不能保证luasvr最后被析构的话就会出现你说的问题。

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

我测试了一下 在编辑器里 这个OnDestroy顺序确实是随机的.
mac Unity 5.2.0
有没有办法调用lua前加个检查?

from slua.

pangweiwei avatar pangweiwei commented on August 18, 2024

我试图merge了,结果发现有问题,又revert了,主要是out类型的参数还要考虑赋值。

from slua.

pangweiwei avatar pangweiwei commented on August 18, 2024

order
我测试了一下,使用MonoManager的Executetion Order 配置其他所有monobehavirou的数值都小于SLua.LuaSvrGameObject的9999就是可以的。

然后destory顺序是

order2

from slua.

pangweiwei avatar pangweiwei commented on August 18, 2024

通过写程序应该可以便利所有monobehavirour设置其数值。

任何在onDestory里调用luastate里报错的MonoBehavirous都可以添加进入列表,保证其析构顺序先于LuaSvr.

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

我这边测试OnDestroy还是随机的,不知道什么情况

执行顺序:

c9d11d9b-ea3c-4fbc-b7a7-ebdd8a5437d6

执行结果1:
769283ee-bd15-4629-8d53-10f34874e171
执行结果2:

另一张,图片总是上传失败,不传了

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

你试一下动态添加脚本 ,而不是事先在编辑器里绑定好

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

我刚测试了下,如果脚本预先都在场景里绑定好了,则顺序是固定的。
否则如果是运行时通过AddComponent绑定上去的,则destroy顺序是随机的

from slua.

pangweiwei avatar pangweiwei commented on August 18, 2024

AddComponent绑定上去后,程序修改,添加进入这个列表不知道行不行?

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

脚本都已经加到执行列表里了

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

http://answers.unity3d.com/questions/1016015/order-of-destroy-objects-and-ondestroy-event.html

有看到类似的问题

from slua.

pangweiwei avatar pangweiwei commented on August 18, 2024

我现在把luasrvgameobject里 dispose luastate的代码注视掉了,等到进程结束自然释放

from slua.

yongkangchen avatar yongkangchen commented on August 18, 2024

OnApplicationQuit呢?
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationQuit.html

from slua.

pangweiwei avatar pangweiwei commented on August 18, 2024

也不行,我测试了

from slua.

wlgys8 avatar wlgys8 commented on August 18, 2024

去掉dispose 暂时应该只能这样了

from slua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.