Comments (4)
以前SimpleCommand有同样的问题,所以SimpleCommand构造函数有一个参数keepStrongRef可以确保是强引用类型,Command中的Action是一个lua对象是正常的。但是你这里的Target,应该是一个视图界面上的对象(UGUI控件、Window或者View对象),如果视图界面存在,就不应该被释放,如果视图不存在了,那么就应该正常解除绑定了。你查查你这绑定的这个target是不是生命周期没管理好,它应该与你的视图是一致的。另外一般来说也不应该是一个lua对象啊
from loxodon-framework.
target是Lua那边的一个View对象,也就是下面绑定代码中的self,gameAlertAsyncInteractionAction是一个AsyncLoadableInteractionActionBase对象,testAsyncInteractionRequest是一个AsyncInteractionRequest 对象。
bindingSet:Bind(self):For("gameAlertAsyncInteractionAction"):To("testAsyncInteractionRequest")
另外,如果我将InteractionAction和InteractionRequest都换成同步的,将UIPrefab放在Resources中,就不会出现target为空的情况(关于这点我还在继续测试),我再多尝试几种绑定方式看看。
from loxodon-framework.
好像破案了...Bind的时候,不加那个self就好了,CreateBindingSet的时候创建的LuaBindingSet里的target是C#的对象
bindingSet:Bind():For("gameAlertAsyncInteractionAction"):To("testAsyncInteractionRequest")
感谢大神解惑~
from loxodon-framework.
好的,解决了就好,有问题在QQ群里面问我吧,沟通起来比较快!
622321589
from loxodon-framework.
Related Issues (20)
- Related to enter play mode settings HOT 6
- Git tag v2.4.5 is not aligned with the version update commit HOT 1
- [Fody]当项目中有其他包引用了Mono.Cecil相关的库文件会报错 HOT 7
- Service container doesn't register generics properly HOT 3
- ProxyType.cs的IsParameterMatch存在问题 HOT 2
- Encryption HOT 3
- Inquiry HOT 3
- [Feature] Split the framework further HOT 1
- Loxodon.Framework.Prefs.DefaultEncryptor带参数的构造函数中key和iv没有赋值啊??? HOT 1
- 请教一下使用ResourcesViewLocator加载的资产什么时候释放呢 HOT 1
- 在FormattableTextMeshProUGUI & TemplateTextMeshProUGUI中Text.text会被自身的OnEnable设置为初始值 HOT 4
- 【功能需求】DataBinding:加入数据更新事件监听 HOT 1
- When will v3.0 be released? HOT 1
- 建议为每个包添加 csc.rsp HOT 6
- Loxodon.Framework.Views.TextMeshPro.GenericParameters在绑定引用类型时有概率崩溃 HOT 2
- AsyncViewInteractionAction parameter IViewGroup should be IUIViewGroup HOT 1
- 可以考虑用 CommunityToolkit.Mvvm HOT 7
- framework/AsyncInteractionRequest.lua:1: unexpected symbol near '<\239>' HOT 1
- Fody.MethodDecorator HOT 4
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 loxodon-framework.