Answers for "ue4 on property changed"

C++
0

ue4 on property changed

//for regular properties:
void ACustomClass::PostEditChangeProperty(struct FPropertyChangedEvent& e)
{     
  FName PropertyName = (e.Property != NULL) ? e.Property->GetFName() : NAME_None;
  if (PropertyName == GET_MEMBER_NAME_CHECKED(UCustomClass, PropertyName))     
  {         
    //various uproperty tricks, see link     
  }     
  
  Super::PostEditChangeProperty(e);
}  

//for TArrays: 
void ACustomClass::PostEditChangeChainProperty(struct FPropertyChangedChainEvent& e) 
{     
  int32 index = e.GetArrayIndex(TEXT("Meshes")); 
  //checks skipped    
  UStaticMesh *mesh = Meshes[index]; 
  //changed mesh     
  Super::PostEditChangeChainProperty(e); 
} 
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language