본문 바로가기
Engine/UNITY

UnityEngineInternal.APIUpdaterRuntimeServices 에러 로그 잡기

by tartist 2016. 9. 28.

UnityEngineInternal.APIUpdaterRuntimeServices를 사용하면 아래와 같은 Warning Log 가 발생한다.

 

warning CS0618: `UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(UnityEngine.GameObject, string, string)' is obsolete: `AddComponent(string) has been deprecated. Use GameObject.AddComponent<T>() / GameObject.AddComponent(Type) instead.

 

이 로그가 발생하지 않도록 하기 위해서는 툴을 거쳐서 스크립트를 집어넣도록 설정했던것을 해당 스크립트로 바로 불러오도록 값을 수정해 주면 에러로그가 발생하지 않는다.

 

예)

string ParticleStrScript = "ParticleCtrl";

 

UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent (PrefabBipProp, "Assets/Scripts/Editor/Art/CHAR_Prefab_FbxChanger.cs", ParticleStrScript); 

 

위 코드를 사용하면 warning이 발생하게 되며 아래와 같이 수정해주면 로그가 사라진다.

 

-->  PrefabBip.AddComponent (typeof(ParticleCtrl));