Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unreal]修复静态绑定: 若结构体没有绑定构造函数则不会生成构造函数定义 #1951

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

morirain
Copy link
Contributor

No description provided.

@chexiongsheng
Copy link
Collaborator

看上去加你这行和没加没区别?

@morirain
Copy link
Contributor Author

    class GameplayTag {
        constructor();
        constructor(TagName: string);
    }

默认会有这两种定义
但如果进行静态绑定但没有加上Constructor 就不会生成默认的定义了

        PUERTS_NAMESPACE::DefineClass<FGameplayTag>()
            // .Constructor<>()
            .Register();

因为代码里如果进入了这个分支的话,里面其实没有任何信息可供生成,但是分支最后会直接return,所以不会生成任何东西

if (ClassDefinition && ClassDefinition->ConstructorInfos)

修改后确定其不为空,如果为空则生成默认的定义

if (ClassDefinition && ClassDefinition->ConstructorInfos && ClassDefinition->ConstructorInfos->Name &&
            ClassDefinition->ConstructorInfos->Type)

@chexiongsheng chexiongsheng merged commit e0a0271 into Tencent:master Dec 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants