Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Will Unity Ads work in my app if I coded it like this?

Discussion in 'Scripting' started by multiplyer, Oct 28, 2015.

  1. multiplyer

    multiplyer

    Joined:
    Jan 28, 2015
    Posts:
    76
    I made a script which reads:

    Code (CSharp):
    1. usingUnityEngine;
    2. usingUnityEngine.Advertisements;
    3.  
    4. publicclassads : MonoBehaviour
    5. {
    6. publicvoidShowAd()
    7. {
    8. if (Advertisement.IsReady())
    9. {
    10. Advertisement.Initialize("MyUnityAdsCode (obviously used the code in the actual script)");
    11.  
    12. Advertisement.Show();
    13. }
    14. }
    15. }
    16.  


    but in the script I want the advert to show, I coded it like this:

    Code (CSharp):
    1. if (other.tag == "tag") {
    2.  
    3. Advertisement.Show();
    4.  
    5. }


    This is my first time finishing an app and I was just wondering whether that would initialise my code, too. I have already uploaded it but I was checking through codes for another app I'm doing then I thought ah it might not initialise my ads code they way I coded it.

    So basically I just wanna know if that will work or if I should update it as soon as it's passed the review process on app store and processing on android store?

    Thanks
     
    Last edited: Oct 28, 2015
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    Put your codes into code tags, it helps other people understand your code.
     
  3. multiplyer

    multiplyer

    Joined:
    Jan 28, 2015
    Posts:
    76
    how do I do that?
     
  4. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
  5. multiplyer

    multiplyer

    Joined:
    Jan 28, 2015
    Posts:
    76