在用ThirdPerosonController设置相机是报错,点击Main Camera就报错,控制角色行走时也报错 ,但是运行时角色行走相机跟随没问题,第一人称和第三人称切换也没问题,就是报错
异常信息
ArgumentException: Instance field 'm_ScrollPosition' is not defined for type 'UnityEditor.InspectorWindow'
System.Linq.Expressions.Expression.Field (System.Linq.Expressions.Expression expression, System.String fieldName) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
Opsive.UltimateCharacterController.Editor.Inspectors.Utility.InspectorVisibility.IsVisible (UnityEditor.Editor editor) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Utility/InspectorVisibility.cs:94)
出问题代码
Func<Vector2> scrollPositionFunction;
if (!s_EditorWindowScrollPositionFunction.TryGetValue(editorWindow, out scrollPositionFunction)) {
// Create the delegate because it's faster to access then reflected fields.
var fieldExpression = Expression.Field(Expression.Constant(editorWindow), c_ScrollPositionString);
if (fieldExpression != null) {
scrollPositionFunction = Expression.Lambda<Func<Vector2>>(fieldExpression).Compile();
}
s_EditorWindowScrollPositionFunction.Add(editorWindow, scrollPositionFunction);
}
Uinty2019.2.17 ThirdPerosonController插件是课程中老师发的插件