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