개발/Unity

event system 2개 만들어지는 현상

dev_caleb 2024. 7. 6. 22:16
728x90

event system duplicated 되면서 계속 오류가 발생했다. 

 

하나씩 멤버들을 비활성하면서 알게 된 결과 

 

문제는 이 UNITY ADS 때문이라는 것을 알게 되었다 그중에서도 initilized할 때 event system이 한개 더생기는 것이었다. 

 

 

https://forum.unity.com/threads/upgrade-to-2020-lts-creating-duplicate-eventsystem.1098133/

 

Upgrade to 2020 LTS creating duplicate EventSystem ?

Hi all, My project was working fine with the 2019 LTS. I just upgraded to the 2020 LTS, and am now having this issue. My starting scene has an...

forum.unity.com

 

 

 

e (CSharp):
  1. var es = FindObjectsOfType<EventSystem>();
  2. if (es.Length > 1)
  3. {
  4.     for (int i = 1; i < es.Length; i++)
  5.     {
  6.         Destroy(es[i].gameObject);
  7.     }
  8. }
  9.  

 

 

나는 이걸로 해결했당 

 

728x90