// Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != null)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     instance = this;
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     instance = this;
 }