// Use this for initialization void Start() { proverkaSingleton = FindObjectOfType <SoundAndMusik>(); if (proverkaSingleton == null) { GameObject go = new GameObject(); go.name = "SingletonController"; proverkaSingleton = go.AddComponent <SoundAndMusik>(); DontDestroyOnLoad(go); } }
void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(gameObject); } _camera = Camera.main; menuMusic = "event:/Music/Kitchen/Music_gameplay"; }