コード例 #1
0
    // Use this for initialization
    void Start()
    {
        ShowAdButton.onClick.AddListener(OnShowAdButtonClicked);

        vrAd = new VRAd(1);
        vrAd.AdStatusChanged += OnAdStatusChanged;

        vrAd.LoadAd();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("OmniVirt SDK Version v" + OmniVirt.SDK.SDK_VERSION);

        ShowAdButton.onClick.AddListener(OnShowAdButtonClicked);

        vrAd = new VRAd(1);
        vrAd.AdStatusChanged += OnAdStatusChanged;

        vrAd.LoadAd();
    }
コード例 #3
0
    IEnumerator ReloadAd()
    {
        yield return(null);

        if (vrAd != null)
        {
            vrAd.Unload();
            vrAd = null;
        }

        vrAd = new VRAd(1);
        vrAd.AdStatusChanged += OnAdStatusChanged;
        vrAd.LoadAd();
    }
コード例 #4
0
 void OnAdStatusChanged(object sender, AdStatusChangedEventArgs e)
 {
     AppendLog("AdState Changed to " + e.Status.ToString());
     if (vrAd.IsLoaded())
     {
         // Enable Show Ad button once ad is ready
         ShowAdButton.interactable = true;
     }
     else if (vrAd.IsCompleted())
     {
         // Reload an ad for next session
         vrAd.LoadAd();
         // Disable Show Ad button while loading
         ShowAdButton.interactable = false;
     }
 }