Ejemplo n.º 1
0
    private void Awake()
    {
        var objs = GameObject.FindGameObjectsWithTag("Music");

        if (objs.Length > 1)
        {
            Destroy(gameObject);
            return;
        }
        musicPlayer.Init(musicSource);
        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 2
0
 protected override void OnAwake() => musicPlayer.Init(musicSource);
 private void Awake() => musicPlayer.Init(musicSource);