반응형

Prefab_Skin = (GameObject)EditorGUILayout.ObjectField("_Skin Object", Prefab_Skin, typeof(GameObject));

라고 코딩을 하자 아래와 같은 에러 로그가 발생했다.

 

warning CS0618: `UnityEditor.EditorGUILayout.ObjectField(string, UnityEngine.Object, System.Type, params UnityEngine.GUILayoutOption[])' is obsolete: `Check the docs for the usage of the new parameter 'allowSceneObjects'.'

 

에러 로그가 발생하지 않으려면 마지막에 Bool 값을 넣어서 아래와 같이 입력해줘야 에러가 발생하지 않는다.

 

_prefabObj = (GameObject)EditorGUILayout.ObjectField("Target Prefab", _prefabObj, typeof(GameObject), true);

 

 

반응형
반응형

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));

 

 

반응형

+ Recent posts