Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. We're excited to be bringing you the newest Unity features, news, demos, and we've even got some special guests from some of the industry’s most storied franchises. Set a reminder to tune in on YouTube here
    Dismiss Notice
  3. Unity 2018.3 is now released.
    Dismiss Notice

[2018.3.0f2][ArgumentException]when i extend RectTransformEditor ,i used refliction

Discussion in 'Extensions & OnGUI' started by heng32032, Dec 25, 2018.

  1. heng32032

    heng32032

    Joined:
    Mar 22, 2018
    Posts:
    2
    when i extend RectTransformEditor,the Editor throw a lot of error like this; i used refliction

    ArgumentException: Object at index 0 is null
    UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at /Users/builduser/buildslave/unity/build/Editor/Mono/SerializedObject.bindings.cs:39)
    UnityEditor.Editor.GetSerializedObjectInternal () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:525)
    UnityEditor.Editor.get_serializedObject () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:432)
    UnityEditor.RectTransformEditor.OnEnable () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/RectTransformEditor.cs:100)
     
  2. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    31
    I've seen these a few times lately in 2018.3 in my custom editor windows, I believe it happens after re-compiling editor code while an instance is open.

    In any event, it looks like a bug to me that can be ignored, at least I couldn't find anything wrong. If an Editor's serializedObject is bad during OnEnable, I'm not sure that's something we can fix anyway?
     
  3. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    32
    Yeah, I have the same problem.
    I made an editor extension grouping a bunch of built-in components editors together in a single editor with tabs; unfortunately, this sometimes happens (after recompiling, as @pdinklag mentioned).

    I didn't run into any problem (such as the Animator not playing, collision detection being disabled etc.), either; however, it keeps spamming these errors in large quantities after each compilation and changing playmode state – until the Editor is restarted. So it's mostly annoying rather than causing genuine trouble.

    Did you report it as a bug? I could only find something similar marked as "Won't Fix" without an explanation here, but hopefully, that's only related to that specific issue, not the whole "recompile with a custom Editor still open" problem.
     
  4. heng32032

    heng32032

    Joined:
    Mar 22, 2018
    Posts:
    2
    yeah, I have post bug reporter to Unity,
     
    schinkowski and Rallix like this.