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