puerts icon indicating copy to clipboard operation
puerts copied to clipboard

[Unreal] 蓝图的枚举类型被当成普通资源处理

Open fonlylovey opened this issue 2 years ago • 4 comments

蓝图的枚举类型在被别的蓝图引用之后,ts生成的声明文件当中会把枚举当做普通资源处理,不是用的UE.EnumName,目前我是吧枚举改成了c++的

QQ图片20220322091650

fonlylovey avatar Mar 22 '22 01:03 fonlylovey

你是想说生成的代码有报错么? 我的生成和你的不太一样

    namespace Game.StarterContent.EnumAABB {
        enum EnumAABB { AA, BB, EnumAABB_MAX}
    }

    namespace Game.StarterContent.NewBlueprint7 {
        class NewBlueprint7_C extends UE.Actor {
            constructor(Outer?: Object, Name?: string, ObjectFlags?: number);
            DefaultSceneRoot: UE.SceneComponent;
            NewVar_0: UE.Game.StarterContent.EnumAABB.EnumAABB;
            NewFunction_0(NewParam: UE.Game.StarterContent.EnumAABB.EnumAABB) : void;
            static StaticClass(): Class;
            static Find(OrigInName: string, Outer?: Object): NewBlueprint7_C;
            static Load(InName: string): NewBlueprint7_C;
        }
        
    }

chexiongsheng avatar Apr 15 '22 04:04 chexiongsheng

还是你的意思是希望能通过UE.Game.StarterContent.EnumAABB.EnumAABB.AA访问到这个AA代表的值?

chexiongsheng avatar Apr 15 '22 04:04 chexiongsheng

还是你的意思是希望能通过UE.Game.StarterContent.EnumAABB.EnumAABB.AA访问到这个AA代表的值?

这种蓝图种定义的枚举应该通过什么方式访问?还有就是蓝图种定义的枚举 如果在蓝图种没有引用的话 头文件就不会生成

lzj10 avatar May 06 '22 02:05 lzj10

我不知道生成的结果是不是对的,我的意思是,我截图里面第一个标注位置的变量类型是对的,myEnum: UE.EAxis;但是是我手动改的ue.d.ts,第二个标注位置的变量类型是自动生成的,但是报错了,而报错的长路径的那个BPs.EAxis.EAxis这个枚举或者说类型在ue.d.ts也存在,但是还是报错,所以我以为被当成普通资产处理了

fonlylovey avatar May 06 '22 02:05 fonlylovey