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
Given a class that derives from Editor, if calling new MyEditor(), Rider will suggest to rewrite this as ScriptableObject.CreateInstance<MyEditor>(). However, since it's an Editor class, it should actually rewrite as Editor.CreateEditor($TARGET$).
It might be better to suggest Editor.CreateEditor($TARGET$, typeof(MyEditor)), in case there are multiple editors for the given target type, and new was being called on a specific type.
Look at the editor type and find the [CustomEditor(typeof(_target_))] to find the type of the target object, and filter suggestions for $TARGET$ based on this type.
Possibly suggest Editor.CreateEditor or Editor.CreateEditorWithContext to allow passing in a context object. I don't know how to suggest what the context object should be.
The text was updated successfully, but these errors were encountered:
Given a class that derives from
Editor
, if callingnew MyEditor()
, Rider will suggest to rewrite this asScriptableObject.CreateInstance<MyEditor>()
. However, since it's anEditor
class, it should actually rewrite asEditor.CreateEditor($TARGET$)
.Editor.CreateEditor($TARGET$, typeof(MyEditor))
, in case there are multiple editors for the given target type, andnew
was being called on a specific type.[CustomEditor(typeof(_target_))]
to find the type of the target object, and filter suggestions for$TARGET$
based on this type.Editor.CreateEditor
orEditor.CreateEditorWithContext
to allow passing in a context object. I don't know how to suggest what the context object should be.The text was updated successfully, but these errors were encountered: