在蓝图或者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参数是空的。