コード例 #1
0
    // Implement a method to execute when the user clicks the button.
    public void ShowAd()
    {
#if UNITY_EDITOR || UNITY_WEBGL || UNITY_STANDALONE
        _showAdButton.interactable = true;
        levelSelector.Continue(lives);
        return;
#elif UNITY_IOS || UNITY_ANDROID
        // Disable the button:
        _showAdButton.interactable = false;
        // Then show the ad:
        Advertisement.Show(_adUnitId, this);
#endif
    }