// Use this for initialization void Start() { if (Instance != null) { GameObject.Destroy(gameObject); } else { GameObject.DontDestroyOnLoad(gameObject); Instance = this; } }
// Use this for initialization void Start() { if (Instance != null) { GameObject.Destroy(gameObject); } else { GameObject.DontDestroyOnLoad(gameObject); Instance = this; } Button btn = AdventureButton.GetComponent <Button>(); btn.onClick.AddListener(loadAdventure); }