Facebook
From BillyMan, 2 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 694
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BGmusic : MonoBehaviour
  6. {
  7.     public static BGmusic instance;
  8.  
  9.     void Awake()
  10.     {
  11.         if (instance != null)
  12.             Destroy(gameObject);
  13.         else
  14.         {
  15.             instance = this;
  16.             DontDestroyOnLoad(this.gameObject);
  17.         }
  18.     }
  19. }
  20.