diff --git a/Content/Ray_Mesh.uasset b/Content/Ray_Mesh.uasset new file mode 100644 index 0000000000000000000000000000000000000000..50b3087142ab0a6b2da9444d0d663e21151dfeed Binary files /dev/null and b/Content/Ray_Mesh.uasset differ diff --git a/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp b/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp index dc71de2e40f586e7c5d00b579e78be716e1d65b2..b3c50870a11402bbe87384908041e6691de5b97d 100644 --- a/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp +++ b/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp @@ -5,12 +5,16 @@ #include "Runtime/InputCore/Classes/InputCoreTypes.h" #include "Runtime/Engine/Classes/Components/InputComponent.h" #include "ConstructorHelpers.h" +#include "Modules/ModuleManager.h" +#include "Interfaces/IPluginManager.h" #include "VirtualRealityPawn.h" UVRWidgetInteractionComponent::UVRWidgetInteractionComponent() { InteractionRay = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Interaction Ray")); - auto MeshAsset = ConstructorHelpers::FObjectFinder<UStaticMesh>(TEXT("StaticMesh'/Engine/BasicShapes/Cone.Cone'")); + FString PluginContentDir = IPluginManager::Get().FindPlugin(TEXT("WidgetInteraction"))->GetContentDir(); + FString ray_mesh_name = TEXT("StaticMesh'") + PluginContentDir + TEXT("/Ray_Mesh.Ray_Mesh'"); + auto MeshAsset = ConstructorHelpers::FObjectFinder<UStaticMesh>(*ray_mesh_name); if (MeshAsset.Object != nullptr) { InteractionRay->SetStaticMesh(MeshAsset.Object); diff --git a/Source/WidgetInteraction/WidgetInteraction.Build.cs b/Source/WidgetInteraction/WidgetInteraction.Build.cs index 5ce59609dc87fef9d3e6387da7ece1eeb3ed7d99..df4ab3bf5449ff699def407c480f224c25a3ba5d 100644 --- a/Source/WidgetInteraction/WidgetInteraction.Build.cs +++ b/Source/WidgetInteraction/WidgetInteraction.Build.cs @@ -25,7 +25,7 @@ public class WidgetInteraction : ModuleRules PublicDependencyModuleNames.AddRange( new string[] { - "Core", + "Core" // ... add other public dependencies that you statically link with here ... } ); @@ -35,15 +35,16 @@ public class WidgetInteraction : ModuleRules new string[] { "CoreUObject", + "Engine", + "Projects", "DisplayCluster", "DisplayClusterInput", - "Engine", "HeadMountedDisplay", "DisplayClusterExtensions", "InputCore", "UMG", "Slate", - "SlateCore", + "SlateCore" // ... add private dependencies that you statically link with here ... } );