You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matt Ellis edited this page Feb 19, 2019
·
2 revisions
If the new keyword is used to create a ScriptableObject, the call will fail at run time. This is because a ScriptableObject needs to be created by the Unity engine so that Unity can call the special methods Start, Update, etc.
This inspection will highlight any attempts to new a ScriptableObject derived class, and provides an Alt+Enter quick fix to rewrite the new as a call to ScriptableObject.CreateInstance<T>().
This inspection corresponds to the Unity runtime warning:
ClassName must be instantiated using the ScriptableObject.CreateInstance method instead of new ClassName