예제 #1
0
 void Awake()
 {
     if (Instance == null)
     {
         Debug.Log("Creando MUSIC CONTROLLER");
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
     else if (Instance != this)
     {
         Debug.Log("Music MURIO");
         Destroy(gameObject);
     }
 }
예제 #2
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
예제 #3
0
    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;
    }
예제 #4
0
 void Awake()
 {
     am          = GameObject.Find("AudioManager").GetComponent <AudioManager>();
     musicPlayer = FindObjectOfType <MusicMenuController>();
 }