You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ViewportDragOperation.h"
|
|
|
|
UViewportDragOperationComponent::UViewportDragOperationComponent( const class FObjectInitializer& Initializer ) :
|
|
Super( Initializer ),
|
|
DragOperation( nullptr )
|
|
{
|
|
|
|
}
|
|
|
|
UViewportDragOperationComponent::~UViewportDragOperationComponent()
|
|
{
|
|
DragOperation = nullptr;
|
|
}
|
|
|
|
UViewportDragOperation* UViewportDragOperationComponent::GetDragOperation()
|
|
{
|
|
return DragOperation;
|
|
}
|
|
|
|
void UViewportDragOperationComponent::SetDragOperationClass( const TSubclassOf<UViewportDragOperation> InDragOperation )
|
|
{
|
|
DragOperationSubclass = InDragOperation;
|
|
}
|
|
|
|
void UViewportDragOperationComponent::StartDragOperation()
|
|
{
|
|
if ( DragOperationSubclass )
|
|
{
|
|
// Reset the drag operation to make sure we start a new one
|
|
ClearDragOperation();
|
|
// Create the drag object with the latest class
|
|
DragOperation = NewObject<UViewportDragOperation>( ( UObject* ) GetTransientPackage(), DragOperationSubclass );
|
|
}
|
|
}
|
|
|
|
void UViewportDragOperationComponent::ClearDragOperation()
|
|
{
|
|
if ( DragOperation )
|
|
{
|
|
DragOperation->MarkPendingKill();
|
|
}
|
|
|
|
DragOperation = nullptr;
|
|
}
|
|
|
|
bool UViewportDragOperationComponent::IsDragging() const
|
|
{
|
|
return DragOperation != nullptr;
|
|
}
|