Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. //TestCompositeComponent.h
  2.  
  3. #pragma once
  4.  
  5. #include "CoreMinimal.h"
  6. #include "Components/SceneComponent.h"
  7. #include "TestCompositeComponent.generated.h"
  8.  
  9.  
  10. UCLASS(Blueprintable, ClassGroup = (Test), meta = (BlueprintSpawnableComponent))
  11. class K1_API UTestCompositeComponent : public USceneComponent
  12. {
  13.     GENERATED_BODY()
  14.  
  15. public:
  16.     // Sets default values for this component's properties
  17.     UTestCompositeComponent();     
  18.    
  19.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = test)
  20.     USceneComponent* TestParent;
  21.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = test)
  22.     UStaticMeshComponent* MyMesh;
  23. };
  24.  
  25. //TestCompositeComponent.cpp
  26.  
  27. #include "K1.h"
  28. #include "TestCompositeComponent.h"
  29.  
  30.  
  31. // Sets default values for this component's properties
  32. UTestCompositeComponent::UTestCompositeComponent()
  33. {
  34.     TestParent = CreateDefaultSubobject<USceneComponent>(TEXT("TestParent"));
  35.     TestParent->SetupAttachment(this);
  36.     MyMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MyMesh"));
  37.     MyMesh->SetupAttachment(TestParent);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement