private void Start() { if (!perm) { perm = this; } else { Destroy(gameObject); } }
public static PermanentUI perm;//instance of object private void Start() { DontDestroyOnLoad(gameObject);//dot destroy object when new create new istance of object if (!perm) { perm = this; } else { Destroy(gameObject); } }
private void Start() { DontDestroyOnLoad(gameObject); if (!perm) { perm = this; } else { Destroy(gameObject); } }
private void Start() { DontDestroyOnLoad(gameObject); // singleton if (!perm) { perm = this; // this = current instance } else { Destroy(gameObject); } }
private void Start() { scene3 = SceneManager.GetActiveScene(); if (!perm) { perm = this; } else { Destroy(gameObject); } }
private void Start() { cherryText.text = "X " + cherries.ToString(); healthAmount.text = "Health " + health.ToString(); DontDestroyOnLoad(gameObject); // singleton if (!perm) { perm = this; } else { Destroy(gameObject); } }
private void Start() { DontDestroyOnLoad(gameObject); //Singleton if (!perm) { perm = this;//this = current instance } else { Destroy(gameObject); } var tempColor = star1.alpha; star1.alpha = tempColor; var tempColor1 = star1.alpha; star2.alpha = tempColor; var tempColor2 = star1.alpha; star3.alpha = tempColor; }
/// <summary> /// zniszcznie UI /// </summary> public void DestroyUI() { perm = null; Destroy(gameObject); }