本文整理汇总了C++中ParticleEmitter::GetLayers方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleEmitter::GetLayers方法的具体用法?C++ ParticleEmitter::GetLayers怎么用?C++ ParticleEmitter::GetLayers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter::GetLayers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SynchronizeEmitterParticleEditorNode
void ParticlesEditorSceneModelHelper::SynchronizeEmitterParticleEditorNode(EmitterParticleEditorNode* node)
{
if (!node)
{
return;
}
ParticleEmitter* emitter = node->GetParticleEmitter();
if (!emitter)
{
return;
}
int layersCountInEmitter = emitter->GetLayers().size();
int layersCountInEmitterNode = node->GetLayersCount();
if (layersCountInEmitter > 0 && layersCountInEmitterNode == 0)
{
// Emitter Node has no layers - need to add them.
for (int32 i = 0; i < layersCountInEmitter; i ++)
{
// Create the new node and add it to the tree.
LayerParticleEditorNode* layerNode = new LayerParticleEditorNode(node, emitter->GetLayers()[i]);
node->AddNode(layerNode);
}
}
}
示例2: EnumerateSpritesForReloading
void SpritePackerHelper::EnumerateSpritesForReloading(SceneData* sceneData, Map<String, Sprite *> &sprites)
{
List<Entity*> particleEffects;
sceneData->GetAllParticleEffects(particleEffects);
for (auto it = particleEffects.begin(); it != particleEffects.end(); ++it)
{
Entity* curNode = (*it);
ParticleEffectComponent * effectComponent = cast_if_equal<ParticleEffectComponent*>(curNode->GetComponent(Component::PARTICLE_EFFECT_COMPONENT));
if (!effectComponent)
{
continue;
}
effectComponent->Stop();
// All the children of this Scene Node must have Emitter components.
int32 emittersCount = curNode->GetChildrenCount();
for (int32 i = 0; i < emittersCount; i ++)
{
Entity* childNode = curNode->GetChild(i);
ParticleEmitter * emitter = GetEmitter(childNode);
if (!emitter)
{
continue;
}
Vector<ParticleLayer*> & layers = emitter->GetLayers();
int32 layersCount = layers.size();
for (int il = 0; il < layersCount; ++il)
{
Sprite *sprite = layers[il]->GetSprite();
sprites[sprite->GetRelativePathname()] = sprite;
}
}
effectComponent->Start();
}
}
示例3: GetLayerIndex
int32 LayerParticleEditorNode::GetLayerIndex() const
{
ParticleEmitter* emitter = GetParticleEmitter();
if (!emitter)
{
return -1;
}
const Vector<ParticleLayer*>& layers = emitter->GetLayers();
int32 layersCount = layers.size();
for (int32 i = 0; i < layersCount; i ++)
{
if (layers[i] == this->layer)
{
return i;
}
}
return -1;
}