各位好, 我打算学习Unity使用XLua热更, 所以创建了一个使用Xlua的Unity项目, 在做对动画完成状态进行监听的操作时, 我突然想到之前看到的一个说法, 添加大量监听可能会导致很多性能损耗, 如果是使用C#我可能会毫不在意, 但是我现在在使用XLua, 我在之前了解到, XLua与C#的交互代价很大, 所以我很担心这两种可能相加导致我的程序原地爆炸, 我目前想到两种方案 第一种就是上述的给每一个对象的spine动画添加监听, 第二种是在Update里判断动画是否播完.
第二个问题我在下载C#运行库的时候注意到有Lua运行库, 我能在Unity中像是在用C#一样使用它吗?
关于监听动画完成和使用Xlua的Unity项目中使用Spine的方法
Regarding your first question, unfortunately machine translation has not provided a clear translation for your question. Are saying that you encounter performance issues when using the spine-unity API through an xLua wrapper? If so, unfortunately I am not familiar with xLua and performance issues regarding C# wrappers. Also I don't know if perhaps there are any settings available which might reduce any call overhead. I'm afraid you would have to ask on xLua forums.
Init 第二个问题我在下载C#运行库的时候注意到有Lua运行库, 我能在Unity中像是在用C#一样使用它吗?
Short answer: No, you can't directly use the spine-lua core runtime with teh spine-unity runtime in Unity and xLua.
Note that the core runtimes just provide basic functionality and can't be used in isolation, they require a rendering- and asset management runtime as well to be useful in a game-toolkit.
Please also note that the spine-lua runtime has been deprecated and removed after runtime version 4.0, it is not present in version 4.1 or 4.2-beta. If you start a new project, we highly recommend using the latest stable (currently 4.1) or beta (currently 4.2-beta) version of the Spine Editor and the Spine runtimes.
Harald
感谢您的回复! 很抱歉我之前的语义不够清晰, 我在提出问题后很快意识到我对spine不够了解, 仅仅停留在播放动画, 暂停动画等简单操作上, 我认为有可能是这个原因导致我不能想到一个比较好的解决方案, 所以我打算再去深入学习一下spine. 这个软件非常强大, 感谢你们!!!!!!!
感谢您告知我lua已被弃用, 我之前并未特意去关注这些消息
Thank you for your reply! I apologize for my previous message not being clear enough. Shortly after posing my question, I realized that my understanding of Spine was quite superficial, mainly limited to basic functions like playing and pausing animations. I think this might be the reason why I couldn't think of a better solution, so I plan to delve deeper into studying Spine. This software is incredibly powerful, thank you!!!!
Thank you for informing me that Lua has been deprecated; I hadn't been specifically paying attention to such news before.
No need to apologize! Glad it helped, thanks for getting back to us.