void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
IEnumerator GameReset() { DeathCanvas.SetActive(true); yield return(new WaitForSeconds(3)); SceneManager.LoadScene("Main Menu"); DoNotDes[] Gos = Fs <DoNotDes>(); DoNotDes.Created = false; foreach (DoNotDes go in Gos) { if (go.gameObject != gameObject) { D(go.gameObject); } } yield return(new WaitForSeconds(0)); D(gameObject); }
void Start() { Instance = this; gameObject.SetActive(false); GetComponent <CanvasGroup>().alpha = 1.0f; }
void spawnDC() { dc = Instantiate(deadCanvas); dcdc = dc.GetComponent <DeathCanvas> (); dc.SetActive(false); }