Пример #1
0
void UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode)
{
	Super::Tick( DeltaSeconds, bIdleMode );

	// Increment the "seconds since last autosave" counter, then try to autosave.
	if (!GSlowTaskOccurred)
	{
		// Don't increment autosave count while in game/pie/automation testing or while in Matinee
		const bool PauseAutosave = (PlayWorld != NULL) || GIsAutomationTesting;
		if (!PauseAutosave && PackageAutoSaver.Get())
		{
			PackageAutoSaver->UpdateAutoSaveCount(DeltaSeconds);
		}
	}
	if (!GIsSlowTask)
	{
		GSlowTaskOccurred = false;
	}

	// Display any load errors that happened while starting up the editor.
	static bool bFirstTick = true;
	if (bFirstTick)
	{
		FEditorDelegates::DisplayLoadErrors.Broadcast();
	}
	bFirstTick = false;

	if(PackageAutoSaver.Get())
	{
		PackageAutoSaver->AttemptAutoSave();
	}

	// Try and notify the user about modified packages needing checkout
	AttemptModifiedPackageNotification();

	// Attempt to warn about any packages that have been modified but were previously
	// saved with an engine version newer than the current one
	AttemptWarnAboutPackageEngineVersions();

	// Attempt to warn about any packages that have been modified but the user
	// does not have permission to write them to disk
	AttemptWarnAboutWritePermission();

	// Update lightmass
	UpdateBuildLighting();

	FAVIWriter* AVIWriter = FAVIWriter::GetInstance();
	if (AVIWriter)
	{
		AVIWriter->Update(DeltaSeconds);
	}
	
	ICrashTrackerModule* CrashTracker = FModuleManager::LoadModulePtr<ICrashTrackerModule>( FName("CrashTracker") );
	bool bCrashTrackerEnabled = false;
	if (CrashTracker)
	{
		CrashTracker->Update(DeltaSeconds);
		bCrashTrackerEnabled = CrashTracker->IsCurrentlyCapturing();
	}

	// Only allow live streaming if crash tracker is disabled. This is because the SlateRHIRenderer shares the same render targets
	// for both crash tracker and live editor streaming, and we don't want them to be thrashed every frame.
	if( !bCrashTrackerEnabled )
	{
		// If the editor is configured to broadcast frames, do that now
		if( IEditorLiveStreaming::Get().IsBroadcastingEditor() )
		{
			IEditorLiveStreaming::Get().BroadcastEditorVideoFrame();
		}
	}
}