puerts
puerts copied to clipboard
[Unreal 4.26]蓝图生成问题 似乎无法调用扩展函数
ReceiveBeginPlay(): void {
let world = this.GetWorld()
let actor = world.SpawnActor(UE.MainActor.StaticClass(), undefined, UE.ESpawnActorCollisionHandlingMethod.Undefined, undefined, undefined) as UE.MainActor;
}
let actor = world.SpawnActor(UE.MainActor.StaticClass(), undefined, UE.ESpawnActorCollisionHandlingMethod.Undefined, undefined, undefined);
^
TypeError: world.SpawnActor is not a function
基于新Clone的Demo测试,也写过其他的扩展函数测试过,在QuickStart.ts的虚拟机中测试正常,蓝图生成则会出现错误。
扩展函数要放到启动JSEnv所在模块,也就是puerts模块里,否则遍历不到
懂了,所以其实不算bug,用文档说明会好一点。
所以请问这个该怎么写?