示例#1
0
 private void Awake()
 {
     if (SoundInstance == null)
     {
         SoundInstance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (SoundInstance != this)
     {
         Destroy(gameObject);
     }
 }
示例#2
0
 private void Awake()
 {
     if (SoundIns == null)
     {
         SoundIns = this;
     }
     else if (SoundIns != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }