// Oleg Petruny proprietary.

#pragma once

#include "InteractableActivator.h"

#include "RaycastInteractableActivator.generated.h"

/**
 * Activates interactable with a single raycast from a camera center
 */
UCLASS(Blueprintable, BlueprintType, ClassGroup = InteractableActivator, meta = (BlueprintSpawnableComponent, ShortTooltip = "Activates interactable with a single raycast from a camera center"), MinimalAPI)
class URaycastInteractableActivator : public UInteractableActivator
{
    GENERATED_BODY()

public:
    URaycastInteractableActivator(const FObjectInitializer& ObjectInitializer);

    virtual bool AutoInstantiateInPlayer() override { return true; }

    virtual void Rescan_Implementation() override;

protected:
    virtual void Scan_Implementation() override;

private:
    class AInteractable* lastInteractable = nullptr;
    bool activated = false;
};
