diff --git a/Source/WidgetInteraction/Private/RwthComponent.cpp b/Source/WidgetInteraction/Private/RwthComponent.cpp index d74511ce66129eb8bfe775f57fc0a20c978d15e2..2685e08e4b8d766cadea1404b1057f71ff6308dc 100644 --- a/Source/WidgetInteraction/Private/RwthComponent.cpp +++ b/Source/WidgetInteraction/Private/RwthComponent.cpp @@ -12,7 +12,7 @@ URwthComponent::URwthComponent() void URwthComponent::Init() { - bShowDebug = true; + SetVisibility(true); InteractionDistance = 1000000.0f; auto input_cmp = dynamic_cast<UInputComponent*>(GetOwner()->GetComponentByClass(UInputComponent::StaticClass())); @@ -23,6 +23,10 @@ void URwthComponent::Init() RegisterComponent(); } +void URwthComponent::SetVisibility(bool visible) { + bShowDebug = visible; +} + void URwthComponent::OnFire(bool val) { if (val == true) diff --git a/Source/WidgetInteraction/Private/WidgetInteraction.cpp b/Source/WidgetInteraction/Private/WidgetInteraction.cpp index 40b70e8f572f4ba9481a28f58b869a44fc6cf0c6..f414d1d36a5e20cf120c0af09964b85bffd57fe5 100644 --- a/Source/WidgetInteraction/Private/WidgetInteraction.cpp +++ b/Source/WidgetInteraction/Private/WidgetInteraction.cpp @@ -89,6 +89,10 @@ void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val } } +URwthComponent* FWidgetInteractionModule::GetWidgetInteractionComponent() { + return widget_interaction_cmp_; +} + void FWidgetInteractionModule::CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer) { widget_interaction_cmp_ = NewObject<URwthComponent>(outer, URwthComponent::StaticClass()); diff --git a/Source/WidgetInteraction/Public/RwthComponent.h b/Source/WidgetInteraction/Public/RwthComponent.h index fb7657858ced622c10fe552e135f056e8f1545d2..d5fda411e5ad92d4c1b3d9ed6f4a6e9fa4c9f0ed 100644 --- a/Source/WidgetInteraction/Public/RwthComponent.h +++ b/Source/WidgetInteraction/Public/RwthComponent.h @@ -18,6 +18,8 @@ public: void Init(); + void SetVisibility(bool visible); + protected: void OnFire(bool val); diff --git a/Source/WidgetInteraction/Public/WidgetInteraction.h b/Source/WidgetInteraction/Public/WidgetInteraction.h index 747a3bdc6f3a7f13ef4471bdbf077864b0d2001d..d1b7bb79aa5179f5b8a93e08283233ad0516feb7 100644 --- a/Source/WidgetInteraction/Public/WidgetInteraction.h +++ b/Source/WidgetInteraction/Public/WidgetInteraction.h @@ -7,7 +7,7 @@ #include "RwthComponent.h" #include "Modules/ModuleManager.h" -class FWidgetInteractionModule : public IModuleInterface +class WIDGETINTERACTION_API FWidgetInteractionModule : public IModuleInterface { public: @@ -18,6 +18,8 @@ public: UFUNCTION() void OnWorldTickStart(ELevelTick, float); + URwthComponent* GetWidgetInteractionComponent(); + private: void CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer);