Skip to content

Instantly share code, notes, and snippets.

@jmoyers
Created March 22, 2014 09:54
Show Gist options
  • Save jmoyers/9703970 to your computer and use it in GitHub Desktop.
Save jmoyers/9703970 to your computer and use it in GitHub Desktop.
Blueprint integration
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "TestUnrealCodeProject.h"
#include "ProximityLight.h"
AProximityLight::AProximityLight(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
PointLight = PCIP.CreateDefaultSubobject<UPointLightComponent>(this, "PointLight");
PointLight->SetBrightness(1000.0f);
PointLight->bVisible = true;
RootComponent = PointLight;
SphereTrigger = PCIP.CreateDefaultSubobject<USphereComponent>(this, "SphereTrigger");
SphereTrigger->InitSphereRadius(250.0f);
SphereTrigger->AttachParent = RootComponent;
}
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/Actor.h"
#include "ProximityLight.generated.h"
/**
*
*/
UCLASS()
class AProximityLight : public AActor
{
GENERATED_UCLASS_BODY()
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Proximity Light Components")
TSubobjectPtr<UPointLightComponent> PointLight;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Proximity Light Components")
TSubobjectPtr<USphereComponent> SphereTrigger;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment