Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class MusicNotDestroy : MonoBehaviour
  6. {
  7. static bool D;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. if(D)
  12. {
  13. Destroy(gameObject);
  14. }
  15. else{
  16. D = true;
  17. DontDestroyOnLoad(gameObject);
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement