Skip to content

在lua中将一个TMap调用Keys或者Values返回的数组作为参数传给c++,c++端收到的数组参数是空的 #407

@daiwei1999

Description

@daiwei1999

在蓝图或者c++定义一个TMap,类型随意,比如:
TMap<int32, int32> TestMap;
然后给TestMap添加一些元素,让其不为空,在lua中调用TestMap的Keys或者Values方法,并将返回值作为参数传给c++函数,比如在c++定义一个Func函数:
UFUNCTION(BlueprintCallable)
void Func(TArray Array);
在lua中调用此Func函数:
self:Func(self.TestMap:Keys())
self:Func(self.TestMap:Values())
在c++的Func函数中设断定可以看到Array参数是空的。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions