繁体   English   中英

统一错误(脚本检查器3):不允许从ScriptableObject构造函数调用GetBool

[英]Error in unity(Script Inspector 3): GetBool is not allowed to be called from a ScriptableObject constructor

GetBool is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'FGConsole'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEditor.EditorPrefs:GetBool(String, Boolean)
ScriptInspector.FGConsole:.cctor() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGConsole.cs:65)

将Script Inspector 3统一用作资产后,统一出现错误。 上面的错误在控制台中显示,它不允许我将脚本附加到游戏对象并编译我的错误。 如何清除此错误?

Niresh,您正在使用的Script Inspector 3版本对于Unity的较新版本而言太旧了。 2016年7月,Unity发布了5.4版,并且Script Inspector 3升级到了3.0.13版以支持这些更改。 只需将您的副本从Unity Asset Store更新到最新发布的Si3版本(当前为3.0.17),它将可以正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM