Advertisement
diliupg

TheMusicPlayerScript

Feb 21st, 2018
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class MusicPlayer : MonoBehaviour
  5. {  
  6.     public static MusicPlayer theMusicPlayerObject = null;
  7.    
  8.     void Awake()
  9.     {
  10.         theMusicPlayerObject = this;
  11.         GameObject.DontDestroyOnLoad(gameObject); // the gameObject inside the brackets is the Music player object
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement