Ejemplo n.º 1
0
 void Awake()
 {
     if (GenericNetworkManager.instance == null)
     {
         GenericNetworkManager.instance = this;
     }
     else
     {
         if (GenericNetworkManager.instance != this)
         {
             Destroy(GenericNetworkManager.instance.gameObject);
             GenericNetworkManager.instance = this;
         }
     }
     DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 2
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            if (Instance != this)
            {
                Destroy(Instance.gameObject);
                Instance = this;
            }
        }

        DontDestroyOnLoad(gameObject);
    }