private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(gameObject); } }
// Use this for initialization void Start() { fadeScreen = GameObject.Find("ScreenFade").GetComponent <Image>(); canvas = GameObject.Find("UI Canvas").GetComponent <CanvasVisibility>(); }