空的精灵或影片剪辑会减慢应用程序的速度吗
只是想知道空的影片剪辑或精灵是否会减慢应用程序或游戏的速度。原因是因为我想使用多个精灵作为我的对象的容器。这样我就可以轻松管理其他人面前的对象。游戏中的某些点,图层将是空的,所以我只是好奇如果这些图层没有被使用,我是否应该将它们设为空,或者这会产生很大的差异。谢谢!
Just curious to know if empty movie clips or sprite can slow down a application or game. Reason being is because I want to use multiple sprites as containers for my object. So I can easy manage what objects are in front of others. Some points in the game, layers will be empty so I am just curious if I should just make those layers null if they arent being used or will that even make a big difference. thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的!您创建的每个对象最终都需要一些资源。 但是在遇到任何问题之前,您必须创建相当多的项目。很可能,您不必担心这一点。 (在这种情况下)
删除用完的任何对象总是一个好主意,但是
new
关键字非常昂贵,所以如果您知道很快将再次需要一个对象,只需坚持下去。尤其是像空精灵这样的小东西。Yes! Every object you create ultimately requires some resources. But you're going to have to create quite a few before you run into any problems. Odds are, you don't have to worry about it. (in this case)
It's always a good idea to remove any objects you are done with, but the
new
key word is really expensive, so if you know you are going to need an object again soon, just hold on to it. Especially something small like an empty Sprite.