示例#1
0
    public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
    {
        // If there is an obstacle, we can remove it to continue the game
        if (obstacle != null && showResult == ShowResult.Finished)
        {
            obstacle.Continue();
        }

        // Unpause when ad is over
        PauseScreenBehaviour.paused = false;
        Time.timeScale = 1f;
    }
示例#2
0
    private static void HandleShowResult(ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            // Successfully shown, can continue game
            obstacle.Continue();
            break;

        case ShowResult.Skipped:
            Debug.Log("Ad skipped, do nothing");
            break;

        case ShowResult.Failed:
            Debug.LogError("Ad failed to show, do nothing");
            break;
        }

        // Unpause when ad is over or when called
        PauseScreenBehaviour.paused = false;
        Time.timeScale = 1f;
    }