Is it possible to create a light using a void function, instead of creating a new class and spawning an actor? (in editor from a plugin, not at runtime)
for example, I have: (mostly copied from the lightswitch tutorial)
.h
#pragma once
#include "GameFramework/Actor.h"
#include "vpCreate.generated.h"
UCLASS()
class AvpCreate : public AActor
{
GENERATED_BODY()
public:
/** point light component */
UPROPERTY()
class UPointLightComponent* PointLight1;
AvpCreate(const FObjectInitializer& ObjectInitializer);
UFUNCTION()
static void MakePLight(FString PLightName, FVector location);
};
.cpp
#include "m2uPluginPrivatePCH.h"
#include "vpCreate.h"
AvpCreate::AvpCreate(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
PointLight1 = ObjectInitializer.CreateDefaultSubobject<UPointLightComponent>(this, "PointLight1");
}
void AvpCreate::MakePLight(FString PLightName, FVector location)
{
}
Can I create a light with the MakePLight function? So that I can call it from another class? If so, do i even need the ObjectInitializer stuff?
thanks!