예제 #1
0
 void Start()
 {
     if (instance)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
예제 #2
0
    public Slider slider;                       //	Loading slider.

    void Start()
    {
        // Getting instance. If same exists, destroy it.
        if (instance)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
    }