Fixed ambiguous method return in Unity 5 release.

This commit is contained in:
pharan 2015-03-04 10:13:53 +08:00
parent 2de88fc6aa
commit b28b7674d8

View File

@ -53,9 +53,9 @@ public class SkeletonRendererInspector : Editor {
front = serializedObject.FindProperty("frontFacing");
if(EditorGUILayoutSortingLayerField == null)
EditorGUILayoutSortingLayerField = typeof(EditorGUILayout).GetMethod("SortingLayerField", BindingFlags.Static | BindingFlags.NonPublic);
EditorGUILayoutSortingLayerField = typeof(EditorGUILayout).GetMethod("SortingLayerField", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(GUIContent), typeof(SerializedProperty), typeof(GUIStyle) }, null);
rendererSerializedObject = new SerializedObject(((SkeletonRenderer)target).renderer);
rendererSerializedObject = new SerializedObject(((SkeletonRenderer)target).GetComponent<Renderer>());
sortingLayerIDProperty = rendererSerializedObject.FindProperty("m_SortingLayerID");
}
@ -108,7 +108,7 @@ public class SkeletonRendererInspector : Editor {
if(renderer != null) {
EditorGUI.BeginChangeCheck();
if(sortingLayerIDProperty != null) {
if(EditorGUILayoutSortingLayerField != null && sortingLayerIDProperty != null) {
EditorGUILayoutSortingLayerField.Invoke(null, new object[] { new GUIContent("Sorting Layer"), sortingLayerIDProperty, EditorStyles.popup } );
} else {
renderer.sortingLayerID = EditorGUILayout.IntField("Sorting Layer ID", renderer.sortingLayerID);