카테고리 없음

[unity ] 인스턴스 안사라지게끔

SKIAP 2020. 10. 21. 20:30

 

 

    private void Awake()
    {
        ScreenOptimization();
        if (instance== null)
        {
            instance = this;
        }
        else
        {
            Debug.Log("씬에 두개 이상의 게임 매니저가 존재합니다.");
            Destroy(gameObject);
        }
    }