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


C++ Entity::Clone方法代码示例

本文整理汇总了C++中Entity::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ Entity::Clone方法的具体用法?C++ Entity::Clone怎么用?C++ Entity::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entity的用法示例。


在下文中一共展示了Entity::Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Update

	void ActionCreateEntityFromFile::Update(WorldState& worldState)
	{ 
		assert(worldState.sector != nullptr);

		Entity* entityCopy = worldState.world->ClassDefinitionContainer.FindEntity((*this)[ATTRIBUTE_ENTITY_CLASS_NAME].Get<std::string>());
		assert(entityCopy != nullptr);

		Entity* newEntity = entityCopy->Clone(*entityCopy)->AssertiveAs<Entity>();

		worldState.sector->AdoptEntity(*newEntity, (*this)[ATTRIBUTE_ENTITY_INSTANCE_NAME].Get<std::string>());

		newEntity->BeginPlay(worldState);
		*mNewEntity = *newEntity;
	}
开发者ID:Nihav-Jain,项目名称:GeometryWars,代码行数:14,代码来源:ActionCreateEntityFromFile.cpp

示例2: Scene

DAVA::Scene * DAEConvertAction::CreateSceneFromSce() const
{
    FilePath scePath = FilePath::CreateWithNewExtension(daePath, ".sce");
    
    Scene *scene = new Scene();
    Entity *rootNode = scene->GetRootNode(scePath);
	if(rootNode)
	{
		rootNode = rootNode->Clone();
		scene->AddNode(rootNode);
		scene->BakeTransforms();
		rootNode->Release();
	}
    
    return scene;
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:16,代码来源:DAEConvertAction.cpp

示例3: Execute

void CommandConvertScene::Execute()
{
    DVASSERT(CheckExtension(String(".dae")) && "Wrong extension");
//    TextureDescriptorUtils::CreateDescriptorsForFolder(EditorSettings::Instance()->GetDataSourcePath());
    DVASSERT(false)
    
    eColladaErrorCodes code = ConvertDaeToSce(filePathname);
    if(code == COLLADA_OK)
    {
        // load sce to scene object
        FilePath path = FilePath::CreateWithNewExtension(filePathname, ".sce");

        Scene * scene = new Scene();
        
        Entity *rootNode = scene->GetRootNode(path);
		if(rootNode)
		{
			rootNode = rootNode->Clone();
			scene->AddNode(rootNode);
			rootNode->Release();
		}
        
        scene->BakeTransforms();
        
        // Export to *.sc2
        path.ReplaceExtension(".sc2");
        scene->Save(path);
        SafeRelease(scene);
    }
    else if(code == COLLADA_ERROR_OF_ROOT_NODE)
    {
        ShowErrorDialog(String("Can't convert from DAE. Looks like one of materials has same name as root node."));
    }
    else
    {
        ShowErrorDialog(String("Can't convert from DAE."));
    }
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:38,代码来源:LibraryCommands.cpp


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