Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (player == null)
     {
         audioSource = GetComponent <AudioSource>();
         DontDestroyOnLoad(gameObject);
         player = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #2
0
 void Awake()
 {
     descriptionAnimator = descriptionPanel.GetComponent <Animator>();
     musicPlayer         = GetComponent <MenuMusicPlayer>();
 }