Plugins/UnLua/Source/UnLuaEditor/Private/UnLuaEditorCore.cpp
/**
* Get all UFUNCTIONs that can be overrode
*/
Get all UFUNCTIONs that can be overrode
Get all UFUNCTIONs that can be overrode
void GetOverridableFunctions(UClass* Class, TMap<FName, UFunction*>& Functions)
{
    if (!Class)
    {
        return;
    }
    for (TFieldIterator<UFunction> It(Class, EFieldIteratorFlags::IncludeSuper, EFieldIteratorFlags::ExcludeDeprecated, EFieldIteratorFlags::IncludeInterfaces); It; ++It)
    {
        UFunction* Function = *It;
        if (IsOverridable(Function))
        {
            FName FuncName = Function->GetFName();
            UFunction** FuncPtr = Functions.Find(FuncName);
            if (!FuncPtr)
            {
                Functions.Add(FuncName, Function);
            }
        }
    }
    for (int32 i = 0; i < Class->ClassReps.Num(); ++i)
    {
        FProperty* Property = Class->ClassReps[i].Property;
        if (Property->HasAnyPropertyFlags(CPF_RepNotify))
        {
            UFunction* Function = Class->FindFunctionByName(Property->RepNotifyFunc);
            if (Function)
            {
                UFunction** FuncPtr = Functions.Find(Property->RepNotifyFunc);
                if (!FuncPtr)
                {
                    Functions.Add(Property->RepNotifyFunc, Function);
                }
            }
        }
    }
}
void GetOverridableFunctions ( UClass * Class , TMap < FName , UFunction * > & Functions ) { if ( ! Class ) { return ; } for ( TFieldIterator < UFunction > It ( Class , EFieldIteratorFlags :: IncludeSuper , EFieldIteratorFlags :: ExcludeDeprecated , EFieldIteratorFlags :: IncludeInterfaces ) ; It ; ++ It ) { UFunction * Function = * It ; if ( IsOverridable ( Function ) ) { FName FuncName = Function -> GetFName ( ) ; UFunction * * FuncPtr = Functions . Find ( FuncName ) ; if ( ! FuncPtr ) { Functions . Add ( FuncName , Function ) ; } } } for ( int32 i = 0 ; i < Class -> ClassReps . Num ( ) ; ++ i ) { FProperty * Property = Class -> ClassReps [ i ] . Property ; if ( Property -> HasAnyPropertyFlags ( CPF_RepNotify ) ) { UFunction * Function = Class -> FindFunctionByName ( Property -> RepNotifyFunc ) ; if ( Function ) { UFunction * * FuncPtr = Functions . Find ( Property -> RepNotifyFunc ) ; if ( ! FuncPtr ) { Functions . Add ( Property -> RepNotifyFunc , Function ) ; } } } } }
Get all UFUNCTIONs that can be overrode
Get all UFUNCTIONs that can be overrode
// all 'BlueprintEvent' // all 'RepNotifyFunc'