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


C++ UActorComponent::IsTemplate方法代码示例

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


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

示例1: DoTask

			void DoTask(ENamedThreads::Type CurrentThread, const FGraphEventRef& MyCompletionGraphEvent)
			{
				for (FTaskArray::TIterator It(*Components); It; ++It)
				{
					UActorComponent* Component = *It;
					if (!Component->IsPendingKill() && Component->IsRegistered() && !Component->IsTemplate())
					{
						FScopeCycleCounterUObject ComponentScope(Component);
						FScopeCycleCounterUObject AdditionalScope(STATS ? Component->AdditionalStatObject() : NULL);
						Component->DoDeferredRenderUpdates_Concurrent();
					}
				}
			}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:13,代码来源:LevelTick.cpp

示例2: SendAllEndOfFrameUpdates

/**
	* Send all render updates to the rendering thread.
	*/
void UWorld::SendAllEndOfFrameUpdates(FGraphEventArray* OutCompletion)
{
	SCOPE_CYCLE_COUNTER(STAT_PostTickComponentUpdate);
	// update all dirty components. 
	bPostTickComponentUpdate = true;

	if (!OutCompletion)
	{
		// this is a viewer or something, just do everything on the gamethread
		for (TSet<TWeakObjectPtr<UActorComponent> >::TIterator It(ComponentsThatNeedEndOfFrameUpdate); It; ++It)
		{
			ComponentsThatNeedEndOfFrameUpdate_OnGameThread.Add(*It);
		}
		ComponentsThatNeedEndOfFrameUpdate.Empty(ComponentsThatNeedEndOfFrameUpdate.Num());
	}
	else
	{
		// remove any gamethread updates from the async update list
		for (TSet<TWeakObjectPtr<UActorComponent> >::TIterator It(ComponentsThatNeedEndOfFrameUpdate_OnGameThread); It; ++It)
		{
			ComponentsThatNeedEndOfFrameUpdate.Remove(*It);
		}
	}

	// Game thread updates need to happen before we go wide on the other threads.
	// These updates are things that have said that they are NOT SAFE to run concurrently.
	for (TSet<TWeakObjectPtr<UActorComponent> >::TIterator It(ComponentsThatNeedEndOfFrameUpdate_OnGameThread); It; ++It)
	{
		UActorComponent* Component = It->Get();
		if (Component && !Component->IsPendingKill() && Component->IsRegistered() && !Component->IsTemplate())
		{
			FScopeCycleCounterUObject ComponentScope(Component);
			FScopeCycleCounterUObject AdditionalScope(STATS ? Component->AdditionalStatObject() : NULL);
			Component->DoDeferredRenderUpdates_Concurrent();
		}
	}

	if (ComponentsThatNeedEndOfFrameUpdate.Num())
	{
		check(OutCompletion);
		enum
		{
			NUM_COMPONENTS_PER_TASK = 20
		};
		typedef TArray<UActorComponent*, TInlineAllocator<NUM_COMPONENTS_PER_TASK> > FTaskArray;
		/** Helper class define the task of calling DoDeferredRenderUpdates_Concurrent on an array of components **/
		class FDoRenderthreadUpdatesTask
		{
			/** Array of components to process, owned by the task **/
			TScopedPointer<FTaskArray>	Components;
		public:
			FDoRenderthreadUpdatesTask(FTaskArray* InComponents)
				: Components(InComponents)
			{
			}
			FORCEINLINE TStatId GetStatId() const
			{
				RETURN_QUICK_DECLARE_CYCLE_STAT(DoRenderthreadUpdatesTask, STATGROUP_TaskGraphTasks);
			}
			static ENamedThreads::Type GetDesiredThread()
			{
				return ENamedThreads::AnyThread;
			}
			static ESubsequentsMode::Type GetSubsequentsMode() 
			{ 
				return ESubsequentsMode::TrackSubsequents; 
			}
			void DoTask(ENamedThreads::Type CurrentThread, const FGraphEventRef& MyCompletionGraphEvent)
			{
				for (FTaskArray::TIterator It(*Components); It; ++It)
				{
					UActorComponent* Component = *It;
					if (!Component->IsPendingKill() && Component->IsRegistered() && !Component->IsTemplate())
					{
						FScopeCycleCounterUObject ComponentScope(Component);
						FScopeCycleCounterUObject AdditionalScope(STATS ? Component->AdditionalStatObject() : NULL);
						Component->DoDeferredRenderUpdates_Concurrent();
					}
				}
			}
		};

		{
			//@todo optimization, this loop could be done on another thread
			// First get the async transform and render data updates underway
			FTaskArray* Array = NULL;
			for (TSet<TWeakObjectPtr<UActorComponent> >::TIterator It(ComponentsThatNeedEndOfFrameUpdate); It; ++It)
			{
				UActorComponent* NextComponent = It->Get();
				if (NextComponent && !NextComponent->IsPendingKill() && NextComponent->IsRegistered() && !NextComponent->IsTemplate())
				{
					if (!Array)
					{
						Array = new FTaskArray;
					}
					Array->Add(NextComponent);
					if (Array->Num() == NUM_COMPONENTS_PER_TASK)
//.........这里部分代码省略.........
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:101,代码来源:LevelTick.cpp


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