o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
void UCustomK2Node::PinConnectionListChanged(UEdGraphPin* Pin) {…
- User
void UCustomK2Node::PinConnectionListChanged(UEdGraphPin* Pin) { Super::PinConnectionListChanged(Pin);
auto z = Cast<UK2Node_VariableGet> (Pin->LinkedTo[0]->GetOwningNode());} как мне получить то, что внутри z?
- Assistant
To access the information inside
z, which is a pointer to aUK2Node_VariableGet, you can use the methods provided by theUK2Node_Variableclass (from whichUK2Node_VariableGetinherits). Specifically, you can retrieve the name of the variable or its associated property. Here's how you can do it:if (z) { // Get the variable name FName VariableName = z->GetVarName(); // Or get the variable property FProperty* VariableProperty = z->GetPropertyForVariable(); // You can now use VariableName or VariableProperty as needed }Explanation:
GetVarName()returns theFNameof the variable that the node represents.GetPropertyForVariable()returns a pointer to theFPropertyassociated with the variable, which provides more detailed information such as type, metadata, etc.
Make sure to check that
zis notnullptrbefore accessing its methods to avoid potential crashes.
By using these methods, you can retrieve and work with the underlying variable information represented by the
UK2Node_VariableGetnode you have obtained.