void Awake() { if (Instance == null) { Debug.Log("Creando MUSIC CONTROLLER"); DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Debug.Log("Music MURIO"); Destroy(gameObject); } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
public void PickUp() { MusicMenuController menu = FindObjectOfType <MusicMenuController>(); FindObjectOfType <AudioManager>().Play("QR Scan"); menu.AddToCollection(musicId); menu.SwitchTrack(musicId); FindObjectOfType <CaptionManager>().StartCaption(new CaptionSentence[] { new CaptionSentence($"New music: \"{menu.musicItems[musicId].name}\" is found!") }); Light light = GetComponentInChildren <Light>(); if (light != null) { light.enabled = false; } pickedUp = true; }
void Awake() { am = GameObject.Find("AudioManager").GetComponent <AudioManager>(); musicPlayer = FindObjectOfType <MusicMenuController>(); }