Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(196评价)
价格: 4009.00元
Unity3D恐怖游戏-惊悚医院(基于ThirdPerosonController) 设置相机报错
Forever_n发起了问答2020-01-16
5
回复
1012
浏览

在用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插件是课程中老师发的插件

所有回复
  • 老师_Trigger 2020-01-16

    同学你好,老师课程中的插件版本是Unity2018的,但这个错误可能是因为我们使用了官方给的模板导致的,这个老师在后续课程里有讲解

    还有-4条回复,点击查看
    你还没有登录,请先登录注册
  • Forever_n 2020-01-17

    而且老师,在设置对象的时候,对象组件中的好多属性都没有  就像人物中的Item Set Manager,课程视频中是有Item Collection但是我自己设置就是没有的

    • 老师_Trigger 2020-01-17

      这个是不应该的,可能是版本问题,建议先使用跟老师一样的版本,或者查找一下最新版本,可以直接搜索一下插件的名称找一下,后续如果老师找到最新版本会回复同学

      (0) 回复
    还有-4条回复,点击查看
    你还没有登录,请先登录注册
  • 老师_Trigger 2020-01-19

    试试这个版本,之前是2.06的,这个是2.12的:

    链接:https://pan.baidu.com/s/1wBX2raGGiCG51JRYXamgGg
    提取码:c4di

     

    还有-5条回复,点击查看
    你还没有登录,请先登录注册
发表回复
你还没有登录,请先 登录或 注册!