51 lines
1.7 KiB
C++
51 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Enums/MujocoEnums.h"
|
|
#include "Structs/MujocoActuator.h"
|
|
#include "Misc/UniqueNamedComponent.h"
|
|
#include "Components/MujocoClassComponent.h"
|
|
#include "MujocoActuatorComponent.generated.h"
|
|
|
|
UCLASS(Blueprintable, ClassGroup = (Rendering, Common), hidecategories = (Object, Activation, "Components|Activation"), ShowCategories = (Mobility), editinlinenew, meta = (BlueprintSpawnableComponent))
|
|
class LUCKYMUJOCO_API UMujocoActuatorComponent : public UActorComponent, public TUniqueNamedComponent
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UMujocoActuatorComponent();
|
|
|
|
UPROPERTY(Transient, VisibleAnywhere, Category = "Mujoco")
|
|
int32 MujocoID = -1;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mujoco")
|
|
FMujocoActuatorV2 Actuator;
|
|
|
|
// Reference to the class component
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mujoco", meta = (AllowPrivateAccess = "true"))
|
|
TObjectPtr<UMujocoClassComponent> ClassComponent;
|
|
|
|
// Function to set class component
|
|
UFUNCTION(BlueprintCallable, Category = "Mujoco")
|
|
void SetClassComponent(UMujocoClassComponent* NewClassComponent);
|
|
|
|
// Function to get class parameters
|
|
UFUNCTION(BlueprintCallable, Category = "Mujoco")
|
|
FString GetClassParameter(const FString& ParamName) const;
|
|
|
|
// Function to check if has class component
|
|
UFUNCTION(BlueprintCallable, Category = "Mujoco")
|
|
bool HasClassComponent() const;
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
virtual void OnComponentCreated() override;
|
|
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
#endif
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
|
|
// Called when the game starts or when spawned
|
|
virtual void OnRegister() override;
|
|
};
|