Rewarded ad debug

This commit is contained in:
2023-08-21 10:55:44 +05:30
parent 3f90e12cfe
commit 07f04580b7
8 changed files with 32 additions and 25 deletions

View File

@@ -125,6 +125,7 @@ public class AdsManager : MonoBehaviour
private void OnRewardSuccess(AdValue obj)
{
Debug.Log("Rewarded Ad success, code:1032");
GameManager.AdWatched();
}

View File

@@ -8,7 +8,7 @@ using UnityEngine;
using UnityEngine.Networking;
public static class DataManager{
public const string API_ENDPOINT = "http://vps.playpoolstudios.com/faucet/golf/api/";
public const string API_ENDPOINT = "https://vps.playpoolstudios.com/faucet/golf/api/";
public const string key = "#2CuV1Bit^S!sW1ZcgRv8BhrO";
public static UserData userData{get; private set;}
public static List<LeaderboardItemData> Leaderboard{get; private set;}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
@@ -253,16 +254,20 @@ public class GameManager : MonoBehaviour
}
public void WatchAd(){
#if UNITY_EDITOR
AdWatched();
#else
AdsManager.instance.ShowRewardedAd();
#endif
}
public static void AdWatched(){
try{
instance.GameOverUI.SetActive(false);
instance.CurStrokes= (int)((float)instance.MaxStrokes/2f);
}catch{
}catch(Exception e){
Debug.LogError("Error giving rewarded strokes, code:1038");
Debug.LogError(e);
}
}