using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.SocialPlatforms;
using KidozSDK;
public class GameOver : MonoBehaviour {
float timer;
public GameObject PA;
public GameObject PAY;
public GameObject PAN;
public GameObject IF;
public AudioSource Timed;
public string GetName = "";
public bool OK;
public GameObject KK;
SaveData data;
// Use this for initialization
void Awake(){
GameObject SV = GameObject.FindGameObjectWithTag ("SV");
data = SaveData.Load (Application.streamingAssetsPath +"\\"+ "Jewelified.uml");
data["GC"] = SV.GetComponent<SavedVars> ().GemsCaught;
data.Save ();
}
void Start () {
timer = 0;
}
public void Okay(){
GameObject TXT = GameObject.FindGameObjectWithTag ("NI");
GetName = TXT.GetComponent<Text> ().text;
OK = true;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.Escape)) {
SceneManager.LoadScene (1);
}
GameObject SV = GameObject.FindGameObjectWithTag ("SV");
if ((!Timed.isPlaying) && (OK)) {
SV.GetComponent<SavedVars> ().Name = GetName;
PA.GetComponent<Text> ().enabled = true;
PAY.GetComponent<Image> ().enabled = true;
PAY.GetComponent<Button> ().enabled = true;
PAN.GetComponent<Image> ().enabled = true;
PAN.GetComponent<Button> ().enabled = true;
IF.GetComponent<Image> ().enabled = false;
IF.GetComponent<InputField> ().enabled = false;
KK.GetComponent<Image> ().enabled = false;
KK.GetComponent<Button> ().enabled = false;
KK.GetComponentInChildren<Text> ().enabled = false;
}
}
public void PlayAgain(){
GameObject SaveG = GameObject.FindGameObjectWithTag ("SV");
if (SaveG.GetComponent<SavedVars> ().GameMode == "PM") {
SceneManager.LoadScene (5);
}
if (SaveG.GetComponent<SavedVars> ().GameMode == "Game") {
SceneManager.LoadScene (1);
}
if (SaveG.GetComponent<SavedVars> ().GameMode == "Coinified"){
SceneManager.LoadScene (7);
}
}
public void GiveUp(){
GameObject Save = GameObject.FindGameObjectWithTag("SV");
Debug.Log (Save.GetComponent<SavedVars> ().GameMode);
if (Save.GetComponent<SavedVars>().GameMode == "PM") {
SceneManager.LoadScene (6);
} if (Save.GetComponent<SavedVars> ().GameMode == "Coinified"){
SceneManager.LoadScene (8);
}
if (Save.GetComponent<SavedVars> ().GameMode == "Game") {
SceneManager.LoadScene (4);
}
}
}
All of a sudden the button for one of the scenes stopped working and I don’t know why the button for the other scenes work, but the Okay function is the one the button is set under. It works on the PC, but not android.