GithubHelp home page GithubHelp logo

Comments (4)

vovgou avatar vovgou commented on July 24, 2024

以前SimpleCommand有同样的问题,所以SimpleCommand构造函数有一个参数keepStrongRef可以确保是强引用类型,Command中的Action是一个lua对象是正常的。但是你这里的Target,应该是一个视图界面上的对象(UGUI控件、Window或者View对象),如果视图界面存在,就不应该被释放,如果视图不存在了,那么就应该正常解除绑定了。你查查你这绑定的这个target是不是生命周期没管理好,它应该与你的视图是一致的。另外一般来说也不应该是一个lua对象啊

from loxodon-framework.

ChaosVan avatar ChaosVan commented on July 24, 2024

target是Lua那边的一个View对象,也就是下面绑定代码中的self,gameAlertAsyncInteractionAction是一个AsyncLoadableInteractionActionBase对象,testAsyncInteractionRequest是一个AsyncInteractionRequest 对象。

bindingSet:Bind(self):For("gameAlertAsyncInteractionAction"):To("testAsyncInteractionRequest")

另外,如果我将InteractionAction和InteractionRequest都换成同步的,将UIPrefab放在Resources中,就不会出现target为空的情况(关于这点我还在继续测试),我再多尝试几种绑定方式看看。

from loxodon-framework.

ChaosVan avatar ChaosVan commented on July 24, 2024

好像破案了...Bind的时候,不加那个self就好了,CreateBindingSet的时候创建的LuaBindingSet里的target是C#的对象

bindingSet:Bind():For("gameAlertAsyncInteractionAction"):To("testAsyncInteractionRequest")

感谢大神解惑~

from loxodon-framework.

vovgou avatar vovgou commented on July 24, 2024

好的,解决了就好,有问题在QQ群里面问我吧,沟通起来比较快!
622321589

from loxodon-framework.

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.