2021-09-28 13:33:00 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Components/SceneComponent.h"
|
|
|
|
|
#include "SmartObjectTypes.h"
|
2021-11-26 15:48:13 -05:00
|
|
|
#include "SmartObjectDefinition.h"
|
2021-09-28 13:33:00 -04:00
|
|
|
#include "SmartObjectComponent.generated.h"
|
|
|
|
|
|
2021-11-02 11:12:43 -04:00
|
|
|
UCLASS(Blueprintable, ClassGroup = Gameplay, meta = (BlueprintSpawnableComponent), config = Game, HideCategories = (Activation, AssetUserData, Collision, Cooking, HLOD, Lighting, LOD, Mobile, Mobility, Navigation, Physics, RayTracing, Rendering, Tags, TextureStreaming))
|
2021-09-28 13:33:00 -04:00
|
|
|
class SMARTOBJECTSMODULE_API USmartObjectComponent : public USceneComponent
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
2021-11-02 11:12:43 -04:00
|
|
|
explicit USmartObjectComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
2021-09-28 13:33:00 -04:00
|
|
|
|
|
|
|
|
FBox GetSmartObjectBounds() const;
|
|
|
|
|
|
2021-11-26 15:48:13 -05:00
|
|
|
const USmartObjectDefinition* GetDefinition() const { return DefinitionAsset; }
|
|
|
|
|
void SetDefinition(USmartObjectDefinition* Definition) { DefinitionAsset = Definition; }
|
2021-09-28 13:33:00 -04:00
|
|
|
|
|
|
|
|
FSmartObjectID GetRegisteredID() const { return RegisteredID; }
|
2021-11-02 11:12:43 -04:00
|
|
|
void SetRegisteredID(const FSmartObjectID Value) { RegisteredID = Value; }
|
|
|
|
|
|
2021-09-28 13:33:00 -04:00
|
|
|
protected:
|
2021-11-02 11:12:43 -04:00
|
|
|
virtual void OnRegister() override;
|
|
|
|
|
virtual void OnUnregister() override;
|
2021-09-28 13:33:00 -04:00
|
|
|
|
2021-11-26 15:48:13 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = SmartObject, BlueprintReadWrite)
|
|
|
|
|
TObjectPtr<USmartObjectDefinition> DefinitionAsset;
|
2021-09-28 13:33:00 -04:00
|
|
|
|
|
|
|
|
/** RegisteredID != FSmartObject::InvalidID when registered into a collection by SmartObjectSubsystem */
|
|
|
|
|
UPROPERTY(Transient, VisibleAnywhere, Category = SmartObject)
|
|
|
|
|
FSmartObjectID RegisteredID;
|
|
|
|
|
};
|