handzlikchris/FastScriptReload

Bug: Odin Inspector 3 compatibility error

949886 opened this issue · 8 comments

949886 commented

I faced an error when I use FastScriptReload with OdinInspector 3:

Library\PackageCache\com.handzlikchris.fastscriptreload@cc5dd52158\Scripts\Editor\NewFields\NewFieldsRendererDefaultEditorPatch.cs(34,141): error CS0103: The name 'DrawOdinInspector' does not exist in the current context

  • My Odin version: 3.1.14.3
  • My Unity version: 2022.3.7
949886 commented

Source of Odin 3.1.14.3 in Sirenix.OdinInspector.Editor.dll:

/// <summary>Draws the default Odin inspector.</summary>
public void DrawDefaultInspector() => this.DrawOdinInspector();

/// <summary>Draws the default Unity inspector.</summary>
public void DrawUnityInspector() => base.DrawDefaultInspector();

private void DrawOdinInspector()
{
    ...
}

maybe help.

You can try to remove those odin specific calls for now. Likely they are using older version

Same issue. Moving the package from
.../Library/PackageCache/com.handzlikchris.fastscriptreload@cc5dd52158
to
.../Library/Packages

and commenting out 32-37 lines in the file
.../Library/Packages/com.handzlikchris.fastscriptreload@cc5dd52158/Scripts/Editor/NewFields/NewFieldsRendererDefaultEditorPatch.cs

will allow compile. not sure of the side effects of this..!

shouldn't be much downside - it's editor for fields added at runtime. Without Odin it should still render normal fields

Zarpyk commented

Source of Odin 3.1.14.3 in Sirenix.OdinInspector.Editor.dll:

/// <summary>Draws the default Odin inspector.</summary>
public void DrawDefaultInspector() => this.DrawOdinInspector();

/// <summary>Draws the default Unity inspector.</summary>
public void DrawUnityInspector() => base.DrawDefaultInspector();

private void DrawOdinInspector()
{
    ...
}

maybe help.

Probably change line 35/36 (of the script NewFieldsRendererDefaultEditorPatch) fix it (I don't know what these methods do)?

var renderAdditionalFieldsDrawOdinInspectorPostfix = AccessTools.Method(typeof(NewFieldsRendererDefaultEditorPatch), nameof(DrawDefaultInspector));
var customOdinEditorRenderingMethod = AccessTools.Method("Sirenix.OdinInspector.Editor.OdinEditor:DrawDefaultInspector");

Related to this issue : #77

My bad! Sorry guys for the issue, should be very easy to fix. More details here.

Compile error as @GhatSmith mentioned, should be fixed with latest push, @949886 - feel free to reopen if still doesn't work after pulling latest