android – 如何在扩展CCLayer的类中使用getAssets
作者:互联网
我有一个扩展CCLayer的课程.我必须从assets文件夹中获取一个文本文件.但我不能在这个类中使用getAssets().如何在扩展CCLayer的类中使用getAssets()?
解决方法:
终于得到了答案……
Context context = CCDirector.sharedDirector().getActivity().getApplicationContext();
InputStream is = context.getAssets().open("abc.txt");
标签:cocos2d-android,android,cclayer 来源: https://codeday.me/bug/20190901/1782495.html