use the value of GrabAttachPointSocketName from the plugin settings as default for USGGrabComponent's AttachmentSocketName uproperty
This commit is contained in:
@@ -37,12 +37,21 @@
|
||||
|
||||
#include "GameFramework/Actor.h"
|
||||
|
||||
#include "SGSettings/SGSettings.h"
|
||||
|
||||
struct USGGrabComponent::FImpl
|
||||
{
|
||||
/************************
|
||||
* Static methods
|
||||
************************/
|
||||
|
||||
FORCEINLINE static const FName& GetDefaultGrabAttachPointSocketName()
|
||||
{
|
||||
const USGSettings* Settings{USGSettings::GetInstance()};
|
||||
const FName& SocketName{Settings->GetVirtualHandSettings().GrabSettings.GrabAttachPointSocketName};
|
||||
return SocketName;
|
||||
}
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
@@ -106,7 +115,7 @@ USGGrabComponent::USGGrabComponent(const FObjectInitializer& ObjectInitializer)
|
||||
AttachmentScaleRule = EAttachmentRule::KeepWorld;
|
||||
bAttachmentWeldSimulatedBodies = true;
|
||||
|
||||
AttachmentSocketName = NAME_None;
|
||||
AttachmentSocketName = FImpl::GetDefaultGrabAttachPointSocketName();
|
||||
|
||||
DetachmentLocationRule = EDetachmentRule::KeepWorld;
|
||||
DetachmentRotationRule = EDetachmentRule::KeepWorld;
|
||||
|
||||
Reference in New Issue
Block a user