コード例 #1
0
ファイル: AudioContoller.cs プロジェクト: IronFake/Asteroids
 private void Awake()
 {
     //Singleton pattern
     if (main != null && main != this)
     {
         Destroy(gameObject);
         return;
     }
     main = this;
 }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     source   = gameObject.GetComponent <AudioSource>();
 }