简体   繁体   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)

I have a error in unity after using Script Inspector 3 in unity as an assets. 将Script Inspector 3统一用作资产后,统一出现错误。 The above error shows in console which does not let me to attach scripts to Game Objects and compile my error. 上面的错误在控制台中显示,它不允许我将脚本附加到游戏对象并编译我的错误。 How to remove this error? 如何清除此错误?

Niresh, the version of Script Inspector 3 you are using is way too old for newer versions of Unity. Niresh,您正在使用的Script Inspector 3版本对于Unity的较新版本而言太旧了。 In July 2016 Unity released version 5.4 and Script Inspector 3 got upgraded to version 3.0.13 to support those changes. 2016年7月,Unity发布了5.4版,并且Script Inspector 3升级到了3.0.13版以支持这些更改。 Just update your copy from Unity Asset Store to the latest released Si3 version (currently 3.0.17) and it will just work fine. 只需将您的副本从Unity Asset Store更新到最新发布的Si3版本(当前为3.0.17),它将可以正常工作。

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

相关问题 Unity:ScriptableObject 的自定义检查器不起作用 - Unity: Custom Inspector for ScriptableObject not working Unity:检查器找不到ScriptableObject的字段 - Unity: Inspector can't find field of ScriptableObject 在 Unity 中的 ScriptableObject 中序列化脚本实例 - Serialize Script Instance in a ScriptableObject in Unity 如何从统一检查器将值传递给构造函数 - How to pass value to constructor from unity inspector Unity 5.4中的ScriptableObject.ctor和LoadAssetAtPath错误 - ScriptableObject.ctor and LoadAssetAtPath error in unity 5.4 “不允许从 MonoBehaviour 构造函数调用加载”在不从 MonoBehaviour 继承的脚本上 - "Load is not allowed to be called from MonoBehaviour constructor" On script that does not inherit from MonoBehaviour UnityException:不允许从 MonoBehaviour 构造函数调用 GetActiveScene - UnityException: GetActiveScene is not allowed to be called from a MonoBehaviour constructor 未调用 ScriptableObject 的 OnEnable 函数 - OnEnable function from of ScriptableObject not being called 将从scriptableobject继承的脚本添加到游戏对象 - Add script inheriting from scriptableobject to game object C# - 不允许从 MonoBehaviour 构造函数调用 RandomRangeInt - C# - RandomRangeInt is not allowed to be called from a MonoBehaviour constructor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM