コード例 #1
0
 void Awake()
 {
     if (instance == null) {
         instance = this;
     } else {
         Destroy(this);
     }
 }
コード例 #2
0
	void Awake(){
		if (instance == null) {
			instance = this;
			DontDestroyOnLoad (gameObject);
		} else {
			Destroy(this);
		}

	}
コード例 #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }