Error CS1526 in (24,46): A new expression requires () or after type and Error CS1525 in (26,33): Unexpected symbol `}’ How do i fix these error? Thank You In Advance.
using UnityEngine;
using UnityEngine.Advertisements;
using System.Collections;
public class LoseScript : MonoBehaviour {
private const int counterReset = 3;
public static int counterForAds = counterReset;
void Awake()
{
if (Advertisement.isSupported) {
Advertisement.allowPrecache = true;
Advertisement.Initialize ("gameid", false);
}
}
void Start() {
counterForAds--;
if (counterForAds <= 0) {
resetCounter();
Advertisement.Show(null, new ShowOptions {
pause = true
resultCallback = result =>
}
});
}
}
public static void resetCounter() {
counterForAds = counterReset;
}
private void OnGUI () {
float width = Screen.width/5;
float height = Screen.height/5;
float x = (Screen.width/2) - (width / 2);
float y = Screen.height - (height * 1.5f);
if(GUI.Button(new Rect(x, y, width, height), "Return to Menu")) {
Application.LoadLevel("GameOver");
}
}
}