Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    28
    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:
    25
    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,
     
    Rallix likes this.