当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Android libgdx how to avoid static method and enum

问题描述:

Ok, now I'm truly mad and confusing. I've start a small project on Android with libgdx and I've been working two days to learn that the asset manager should not be static for some reason. I've also try the singleton option but there is a static getInstance method that bother me. I'm not sure it ok to have a static method instead a the asset manager class.

Managing your assets

So I found out some good solution on here that was telling me to use an enum instead for this purpose. I've never use one before so I studdied that for another day until tonight I found this video that tell me to avoid enum on Android.

The price of ENUMS

Is there another alternative? Or am I getting something wrong with these two sources? I'm kinda of new to Android libgdx and it really frustrating when you can't figure out the right way to do something that you usally know how to do it in other circumstances. My problem is not about coding it, but to understanding the issue of Static or Enum in Android and how to avoid those in my asset manager.

网友答案:

I'm using a singleton that has a non-static asset manager instance and it's running pretty well (3 Android / 3 iOS games). So it should not be a problem.

分享给朋友:
您可能感兴趣的文章:
随机阅读: