ue4 on property changed

Solutions on MaxInterview for ue4 on property changed by the best coders in the world

showing results for - "ue4 on property changed"
Victoria
06 Jan 2017
1 //for regular properties:
2void ACustomClass::PostEditChangeProperty(struct FPropertyChangedEvent& e)
3{     
4  FName PropertyName = (e.Property != NULL) ? e.Property->GetFName() : NAME_None;
5  if (PropertyName == GET_MEMBER_NAME_CHECKED(UCustomClass, PropertyName))     
6  {         
7    //various uproperty tricks, see link     
8  }     
9  
10  Super::PostEditChangeProperty(e);
11}  
12
13//for TArrays: 
14void ACustomClass::PostEditChangeChainProperty(struct FPropertyChangedChainEvent& e) 
15{     
16  int32 index = e.GetArrayIndex(TEXT("Meshes")); 
17  //checks skipped    
18  UStaticMesh *mesh = Meshes[index]; 
19  //changed mesh     
20  Super::PostEditChangeChainProperty(e); 
21