当前位置: 首页>>代码示例>>C++>>正文


C++ ParticleEmitter::GetLayers方法代码示例

本文整理汇总了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);
        }
     }
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:27,代码来源:ParticlesEditorSceneModelHelper.cpp

示例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();
	}
}
开发者ID:,项目名称:,代码行数:41,代码来源:

示例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;
}
开发者ID:,项目名称:,代码行数:21,代码来源:


注:本文中的ParticleEmitter::GetLayers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。