void Awake()
    {
        if (instance != null)
        {
            Debug.LogError("Double instance singleton");
            return;
        }
        instance = this;

        foreach (var obj in objects)
        {
            DontDestroyOnLoad(obj);
        }
    }
Exemplo n.º 2
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("Il y a plus d'un DontDestroyOnLoadScene");
            return;
        }
        instance = this;

        foreach (var element in objects)
        {
            DontDestroyOnLoad(element);
        }
    }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
     foreach (GameObject g in objects)
     {
         DontDestroyOnLoad(g);
     }
 }
Exemplo n.º 4
0
    void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("There is more than one instance of DontDestroyOnLoadScene in the scene.");
            return;
        }

        instance = this;

        foreach (var element in objects)
        {
            DontDestroyOnLoad(element);
        }
    }