Closed IcarusLi closed 2 years ago
void EffectFactory::OnLoadingResource(Effect* effect, const void* data, int32_t size, const char16_t* materialPath)
{
auto resourceMgr = effect->GetSetting()->GetResourceManager();
for (auto i = 0; i < effect->GetColorImageCount(); i++)
{
char16_t fullPath[512];
PathCombine(fullPath, materialPath, effect->GetColorImagePath(i));
effect->AddRef();
char path_[300];
::Effekseer::ConvertUtf16ToUtf8(path_, 300, fullPath);
std::string fullPathimg = cocos2d::FileUtils::getInstance()->fullPathForFilename(path_);
cocos2d::Director::getInstance()->getTextureCache()->addImageAsync(fullPathimg, [=](cocos2d::Texture2D* texN) {
if (texN != nullptr)
{
auto resource = resourceMgr->LoadTexture(fullPath, TextureType::Color);
SetTexture(effect, i, TextureType::Color, resource);
}
effect->Release();
}, fullPathimg,false);
}
new thread do resource(texture) load (base on cocos)
.efkmodel have a very amazing size ...
Android(Virtualbox)
Is it no problem on Android in a smart phone?
no problem,only few low-end phone same as vittualbox.
It should add an option to change the number of instance.
Android(Virtualbox) not good performance when playing a lot of effect at same time , but if changed spriteSize to 50, have a nice fps.