C# 有没有办法找到从unity的广告中赚到的钱
假设一个用户看了一则广告,我想根据我从广告中赚了多少钱来更改奖励。我不想使用ecpm,因为这是一个平均值。我想从一个特定的广告中赚钱。我使用的代码是教程中默认的unity广告代码。给你C# 有没有办法找到从unity的广告中赚到的钱,c#,android,unity3d,ads,C#,Android,Unity3d,Ads,假设一个用户看了一则广告,我想根据我从广告中赚了多少钱来更改奖励。我不想使用ecpm,因为这是一个平均值。我想从一个特定的广告中赚钱。我使用的代码是教程中默认的unity广告代码。给你 const string myPlacementId = "rewardedVideo"; public bool testMode = true; void Start() { Advertisement.AddListener(this);
const string myPlacementId = "rewardedVideo";
public bool testMode = true;
void Start()
{
Advertisement.AddListener(this);
Advertisement.Initialize(gameId, testMode);
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
ShowRewardedVideo();
}
}
public void ShowRewardedVideo()
{
if (Advertisement.IsReady(myPlacementId))
{
Advertisement.Show(myPlacementId);
}
else
{
Debug.Log("Rewarded video is not ready at the moment! Please try again later!");
}
}
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
if (showResult == ShowResult.Finished)
{
print("finishedAd");
}
else if (showResult == ShowResult.Skipped)
{
print("skip");
}
else if (showResult == ShowResult.Failed)
{
Debug.LogWarning("The ad did not finish due to an error.");
}
}
提前谢谢