본문 바로가기
Engine/UNITY

UnityEditor.EditorGUILayout.ObjectField 에러 로그 잡기

by tartist 2016. 9. 28.

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