void InitInstance()
        {
            if (instance == null)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);

                InitPlatform(capacity);
            }
            else if (instance != this)
            {
                Destroy(gameObject);
            }
        }
Beispiel #2
0
 void InitInstance()
 {
     if (instance == null)
     {
         if (InitPlatform(capacity, trim))
         {
             instance = this;
             DontDestroyOnLoad(gameObject);
         }
         else
         {
             Destroy(gameObject);
         }
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }