Пример #1
0
void ParticleEmitter::Load(KeyedArchive *archive, SceneFileV2 *sceneFile)
{
    RenderObject::Load(archive, sceneFile);

    if(NULL != archive)
    {
        if(archive->IsKeyExists("pe.configpath"))
        {
            String filename = archive->GetString("pe.configpath");
            String sceneFilePath = FileSystem::Instance()->SystemPathForFrameworkPath(sceneFile->GetScenePath());
            configPath = FileSystem::Instance()->GetCanonicalPath(sceneFilePath + filename);

#if defined (__DAVAENGINE_ANDROID__)
            String systemPath = FileSystem::Instance()->SystemPathForFrameworkPath("~res:/");
            String::size_type pos = configPath.find(systemPath);
            if(pos == 0)
            {
                configPath = configPath.replace(pos, systemPath.length(), "~res:/");
            }
#endif //#if defined (__DAVAENGINE_ANDROID__)

            LoadFromYaml(configPath);
        }
    }
}
void ParticleEmitterNode::Load(KeyedArchive * archive, SceneFileV2 * sceneFile)
{
	Entity::Load(archive, sceneFile);
	
	String path = archive->GetString("yamlPath");
	yamlPath = sceneFile->GetScenePath() + path;
	LoadFromYaml(yamlPath);
}
Пример #3
0
void ParticleEmitterNode::Load(KeyedArchive * archive, SerializationContext * serializationContext)
{
	Entity::Load(archive, serializationContext);
	
	String path = archive->GetString("yamlPath");
	yamlPath = serializationContext->GetScenePath() + path;
	LoadFromYaml(yamlPath);
}