Hello,
I have this C++ called UPLLoginHandler
derived from UPLPhotonBaseHandler
which also derive from UActorComponent
The problem is in blueprint, if I attach ULoginHandler
as an actor component, and if I close the blueprint editor and reopen it again, it will crashes the editor. I don’t have any problem with UBaseHandler
attached as component, I can reopen it as many times as I want.
here is code for UPLLoginHandler.h
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class PHOTONLEARN_API UPLLoginHandler : public UPLPhotonBaseHandler
{
GENERATED_BODY()
public:
UPLLoginHandler(const FObjectInitializer& ObjectInitializer);
virtual void InitializeComponent();
virtual void HandleOnOperationResponse(const OperationResponse& operationReponse);
virtual void HandleOnStatusChanged(int statusCode) override;
virtual void HandleOnEvent(const EventData& eventData) override;
virtual void HandleDebugReturn(int debugLevel, const JString& string) override;
//UFUNCTION(BlueprintNativeEvent, Category = "Photon")
// void HandleOnStatusChangedBlueprint(int statusCode);
//virtual void HandleOnStatusChangedBlueprint_Implementation(int statusCode);
UPROPERTY(BlueprintReadWrite)
UPLGameInstance* PLGameInstance;
//UPROPERTY(BlueprintAssignable, Category = "Photon")
// FHandleOnStatusChangedDelegate OnStatusChanged;
};
and for UPLPhotonBaseHandler.h
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FHandleOnStatusChangedDelegate, int, StatusCode);
UCLASS( ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class PHOTONLEARN_API UPLPhotonBaseHandler : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UPLPhotonBaseHandler(const FObjectInitializer& ObjectInitializer);
//virtual void BeginPlay() override;
//virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
virtual void HandleDebugReturn(int debugLevel, const JString & string);
virtual void HandleOnOperationResponse(const OperationResponse& operationResponse);
virtual void HandleOnStatusChanged(int statusCode);
virtual void HandleOnEvent(const EventData & eventData);
UPROPERTY(BlueprintAssignable, Category = "Photon")
FHandleOnStatusChangedDelegate OnStatusChanged;
};