本演示项目在Unity for Android Build中启用部分华为HMS和AGC服务,对应的类和函数的名称和用法相同。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

42 行
1.2 KiB

using UnityEngine;
using System.Collections.Generic;
namespace HuaweiService.ads
{
public class RewardAdStatusListenerData : IHmsBaseListener
{
public string name => "com.unity.hms.listener.IRewardAdStatusListener";
public string buildName => "BuildRewardAdStatusListener";
}
public class RewardAdStatusListener : HmsListener<RewardAdStatusListenerData>
{
public virtual void onRewardAdClosed() {
Call("onRewardAdClosed");
}
public virtual void onRewardAdFailedToShow(int arg0) {
Call("onRewardAdFailedToShow", arg0);
}
public virtual void onRewardAdOpened() {
Call("onRewardAdOpened");
}
public virtual void onRewarded(Reward arg0) {
Call("onRewarded", arg0);
}
public void onRewarded(AndroidJavaObject arg0){
onRewarded(HmsUtil.GetHmsBase<Reward>(arg0));
}
public class ErrorCode
{
public const int INTERNAL = 0;
public const int REUSED = 1;
public const int NOT_LOADED = 2;
public const int BACKGROUND = 3;
}
}
}