Quantcast
Channel: Latest Questions by TheShadyColombian
Viewing all articles
Browse latest Browse all 145

WebGL doesn't work when using UnityEngine.Advertisements

$
0
0
Whenever I try to build to WebGL, I receive the following error: Assets/Scripts/SettingsButtons.cs(98,17): error CS0246: The type or namespace name `ShowOptions' could not be found. Are you missing a using directive or an assembly reference? Does this mean that it won't work because of the advertisements? If so, how can I have them automatically be disabled when I build to WebGL? Here's the full script for context (It's a kind of swiss-army knife script so there's a bunch of useless stuff in there. I'll remove what I can) using UnityEngine; using UnityEngine.UI; using UnityEngine.Analytics; using UnityEngine.Advertisements; using System; using System.Collections; using System.Collections.Generic; public class SettingsButtons : MonoBehaviour { public bool Value; public Image Img; public Sprite EnabledSprite; public Sprite DisabledSprite; //Ads Stuff public string zoneId; // Use this for initialization void Start () { GameObject.Find("MainMenu").GetComponent().SetBool("Visible", true); GameObject.Find("ExtraMenu").GetComponent().SetBool("Visible", false); } // Update is called once per frame void Update () { } public void ShowAd () { if (string.IsNullOrEmpty (zoneId)) zoneId = null; ShowOptions options = new ShowOptions(); options.resultCallback = HandleShowResult; Advertisement.Show (zoneId, options); } public void ExpressAppreciation () { GameObject.Find("Thanks").GetComponent().SetTrigger("Show"); } public void ExpressRegret () { GameObject.Find("YouSuck").GetComponent().SetTrigger("Show"); } public void ExpressERROR () { GameObject.Find("Error").GetComponent().SetTrigger("Show"); } private void HandleShowResult (ShowResult result) { switch (result) { case ShowResult.Finished: ExpressAppreciation(); break; case ShowResult.Skipped: ExpressRegret(); break; case ShowResult.Failed: ExpressERROR(); break; } } } Thanks in advance if someone can help.

Viewing all articles
Browse latest Browse all 145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>