在文档https://developers.weixin.qq.com/minigame/dev/guide/open-ability/tournament.html中的擂台领奖环节的js代码如下:
// 监听挑战赛福利组件信息变更
wx.onOfficialComponentsInfoChange(componentInfo => {
let receiveDetail = componentInfo.challengeRewardsComponentInfo?.receiveDetail;
if (receiveDetail) { // 挑战赛礼包领取事件
// 处理奖励领取结果
switch (receiveDetail.awardResult) {
case 1:
console.log('奖励全部领取成功!');
break;
case 2:
console.log('奖励部分领取成功');
break;
case 3:
console.log('奖励领取失败');
break;
}
// 检查是否领取了稀有奖励
if (receiveDetail.receivedRareReward === true) {
console.log('恭喜!领取了稀有奖励!');
}
// 遍历用户领取的奖励列表
receiveDetail.userSourceList.forEach((userSource, index) => {
if (userSource.source) {
console.log(`第${index + 1}个奖励:`);
console.log(' 礼包名称:', userSource.source.sourceName);
// 遍历道具列表
userSource.source.propList?.forEach(prop => {
console.log(`${prop.propName} x${prop.propNum}`);
});
}
});
}
});
我在Unity下已经完全不知道应该怎么处理了,有谁知道吗?
WX.OnOfficialComponentsInfoChange((r) =>
{
GF.Log("擂台赛数据改变->" + r.OfficialComponentsInfo.notificationComponentInfo.name);
});
C#里面从哪里获取receiveDetail相关数据数据?

请问解决了吗?我也遇到这个问题了,文档中的OfficialComponentsInfo有三个属性,但是SDK中只有notificationComponentInfo一个属性