Skip to content
Snippets Groups Projects
Commit 996df9bf authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

VASourceComponent: Now cannot set signal source to none

(only when reverting to default which is none unfortunately)
parent 14ab01e8
Branches
No related tags found
No related merge requests found
......@@ -21,6 +21,9 @@ UVASourceComponent::UVASourceComponent()
{
PrimaryComponentTick.bCanEverTick = true;
//Default objects for subcomponents does not work
//SignalSource = CreateDefaultSubobject<UVAAudiofileSignalSource>(TEXT("SignalSource"), false);
// If the receiver Actor is initialized but this sound Component not, this Component is spawned at runtime and has to be initialized
// Otherwise it will be later on initialized from the Receiver Actor
TArray<AActor*> ReceiverActors;
......@@ -637,21 +640,6 @@ FString UVASourceComponent::GetBoneName() const
#if WITH_EDITOR
void UVASourceComponent::PreEditChange(FProperty* PropertyWhatWillChange)
{
Super::PreEditChange(PropertyWhatWillChange);
// TODO:
// This is true if user directly changes the signal source component to "None"
// However, it is also true if user changes a sub-property of SignalSource
if (PropertyWhatWillChange->GetFName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, SignalSource))
{
UnbindSignalSourceEvents(); //Unbind works for now, since we bind in BeginPlay() again.
//SignalSourceType = nullptr;
}
}
void UVASourceComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
if (PropertyChangedEvent.GetPropertyName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, SignalSourceType))
......
......@@ -42,7 +42,7 @@ protected:
TSubclassOf<UVAAbstractSignalSource> SignalSourceType = UVAAudiofileSignalSource::StaticClass();
// Select the type of the signal source
UPROPERTY(EditAnywhere, Instanced, meta = (DisplayName = "Signal Source", Category = "Signal Source", AllowAbstract = "false"))
UPROPERTY(EditAnywhere, Instanced, NoClear, meta = (DisplayName = "Signal Source", Category = "Signal Source", AllowAbstract = "false"))
UVAAbstractSignalSource* SignalSource = nullptr;
......@@ -241,7 +241,6 @@ private:
protected:
#if WITH_EDITOR
virtual void PreEditChange(FProperty* PropertyWhatWillChange) override;
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
// Function to improve settings displayed in Editor, can only be used in editor mode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment