Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Error with String in code

$
0
0
Hey guys Im trying to make a Reward Ad Button in my game. Unity documentation tells me to copy this code into an empty script and attach it to a game object. This is the only error I get: Expected class, delegate, enum, interface, or struct. It points to the "private string gameID = "1486550";" part of my code at the top. (I have it commented in the code so you can find it). This app is being made for android so I didnt think that was the one that would give me issue. Any help is greatly appreciated! using UnityEngine; using UnityEngine.UI; using UnityEngine.Advertisements; //---------- ONLY NECESSARY FOR ASSET PACKAGE INTEGRATION: ----------// #if UNITY_IOS private string gameId = "1486551"; #elif UNITY_ANDROID private string gameId = "1486550"; //THE STRING HERE IS THE ERROR #endif //-------------------------------------------------------------------// [RequireComponent(typeof(Button))] public class UnityAdsButton : MonoBehaviour { Button m_Button; public string placementId = "rewardedVideo"; void Start () { m_Button = GetComponent

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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