Beispiel #1
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        if (_instance == null)
        {
            _instance = this;
        }

        DontDestroyOnLoad(this);
    }
Beispiel #3
0
    void Awake()        //싱글턴
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }