Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//------------------------------------------------------------------------------------------------------------------------------
// Basic Usage
//------------------------------------------------------------------------------------------------------------------------------
UPROPERTY(EditAnywhere, Category="Demo")
bool MyFlag = true;
UPROPERTY(EditAnywhere, Category="Demo", meta=(EditCondition="MyFlag"))
int MyNumber = 0;
//------------------------------------------------------------------------------------------------------------------------------
// Basic Usage (Inverted)
//------------------------------------------------------------------------------------------------------------------------------
UPROPERTY(EditAnywhere, Category="Demo")
bool MyFlag = true;
UPROPERTY(EditAnywhere, Category="Demo", meta=(EditCondition="!MyFlag"))
int MyNumber = 0;
//------------------------------------------------------------------------------------------------------------------------------
// Basic Usage (Hiding)
//------------------------------------------------------------------------------------------------------------------------------
UPROPERTY(EditAnywhere, Category="Demo")
bool MyFlag = true;
UPROPERTY(EditAnywhere, Category="Demo", meta=(EditCondition="MyFlag", EditConditionHides))
int MyNumber = 0;
//------------------------------------------------------------------------------------------------------------------------------
// Advanced Usage (Enum)
//------------------------------------------------------------------------------------------------------------------------------
UENUM(BlueprintType)
enum class EMovementConfig : uint8
{
ConstantSpeed,
Increment
};
UPROPERTY(EditAnywhere, Category="Demo")
EMovementConfig MovementConfig = EMovementConfig::ConstantSpeed;
UPROPERTY(EditAnywhere, Category="Demo", meta=(EditCondition="MovementConfig == EMovementConfig::ConstantSpeed"))
float Speed = 10.0f;
UPROPERTY(EditAnywhere, Category = "Demo", meta = (EditCondition="MovementConfig == EMovementConfig::Increment"))
float Increment = 1.0f;
//------------------------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.