コード例 #1
0
 void Awake()
 {
     if (singleton != null && singleton != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         singleton = this;
     }
     DontDestroyOnLoad(this);
 }
コード例 #2
0
    //private Chat chat;

    void Awake()
    {
        audio2D = Audio2D.singleton;
        //chat = Chat.singleton;
    }