- Home /
Duplicate Question: On UA multiple times. Comments provide sufficient detail for OP to fix problem.
error CS8025: Parsing error
Hello guys, I'm new to coding, however I created a simple 2D game for android devices with the help of a template and some tutorials to modify it. Anyway, I would like to monetize the game with Chartboost ads. I tried to write a script that when the game opens, when the Menu appears the ad will pop up/show. Below you can see the script I made in C#. I am getting this error: Assets/Ad Networks Prefabs/Show Ads.cs(28,9): error CS8025: Parsing error
using UnityEngine;
using System.Collections;
public class ShowAds : MonoBehaviour {
string chartboostAppID = "hidden for secure purposes";
string chartboostAppSignature = "hidden for secure purposes";
// Use this for initialization
void Start () {
ChartboostAndroid.init( chartboostAppID, chartboostAppSignature, true );
ChartboostAndroid.cacheInterstitial( null );
i=Random.Range(1,4);
if(i==2)
{
Ads();
}
}
void Ads (){
ChartboostAndroid.showInterstitial( null );
}
}
}
// Update is called once per frame
void Update () {
}
}
Just as @robertu stated, you have extra braces in your code. Delete the braces at lines 26 and 28. That should fix the problem.
Follow this Question
Related Questions
Unity Video ads closing when player leaves app. 2 Answers
Are apps with unity ads allowed in amazon app store?? 1 Answer
App asking for permissions that are not needed 2 Answers
How to implement Admob Native Ads on a ScrollRect in Unity 2 Answers
Unity ads are working in editor but not on android device 2 Answers