本文整理汇总了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;
}
示例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;
}
示例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."));
}
}