mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Move defaults change to constructor instead of OnRegister, fix SetIsVizualisationComponent only being available in editor builds
This commit is contained in:
parent
44dad3b505
commit
1a1b66c3e9
@ -4,16 +4,18 @@
|
||||
#include "StevesEditorVisComponent.h"
|
||||
#include "StevesDebugRenderSceneProxy.h"
|
||||
|
||||
void UStevesEditorVisComponent::OnRegister()
|
||||
UStevesEditorVisComponent::UStevesEditorVisComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: UPrimitiveComponent(ObjectInitializer)
|
||||
{
|
||||
Super::OnRegister();
|
||||
|
||||
// set up some constants
|
||||
SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
PrimaryComponentTick.bCanEverTick = false;
|
||||
SetCastShadow(false);
|
||||
#if WITH_EDITORONLY_DATA
|
||||
SetIsVisualizationComponent(true);
|
||||
#endif
|
||||
SetHiddenInGame(true);
|
||||
AlwaysLoadOnClient = false;
|
||||
bIsEditorOnly = true;
|
||||
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ struct FStevesEditorVisCircle
|
||||
* If you want to, you can add this to your Blueprints too. This component automatically marks itself as "visualisation
|
||||
* only" so shouldn't have a runtime impact.
|
||||
*/
|
||||
UCLASS(ClassGroup="Debug", hidecategories=(Collision,Object,LOD,Lighting,TextureStreaming), meta=(DisplayName="Steves Editor Visualisation", BlueprintSpawnableComponent))
|
||||
UCLASS(ClassGroup="Debug", hidecategories=(Collision,Physics,Object,LOD,Lighting,TextureStreaming), meta=(DisplayName="Steves Editor Visualisation", BlueprintSpawnableComponent))
|
||||
class STEVESUEHELPERS_API UStevesEditorVisComponent : public UPrimitiveComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
@ -67,7 +67,8 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TArray<FStevesEditorVisCircle> Circles;
|
||||
|
||||
virtual void OnRegister() override;
|
||||
UStevesEditorVisComponent(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
virtual FPrimitiveSceneProxy* CreateSceneProxy() override;
|
||||
virtual FBoxSphereBounds CalcBounds(const FTransform& LocalToWorld) const override;
|
||||
/// Needs to update on transform since proxy is detached
|
||||
|
Loading…
x
Reference in New Issue
Block a user