Ejemplo n.º 1
0
    void Awake()
    {
        if(Instance != null && Instance != this){
            Destroy(gameObject);
        }

        Instance = this;

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