Closed LaughingLeader closed 6 years ago
First quick look at the callstack turns up this line as the one throwing the exception, which could happen when there is a Component type in the constraint graph that is not part of the list of Component types to be ordered.
RequiredComponent
or execution order related attributes referring to types that are (a) not Components or (b) not public / exported types, and if that turns out to be the cause...After further testing it appears it was my [RequiredComponent] calls on my SpriteSheetInterpreter.cs class. Removing those fixes the crashes.
Ah, that makes sense. This seems to be the class in question:
[RequiredComponent(typeof(Pixmap), typeof(JsonData))]
public class SpriteSheetInterpreter : Component
{
// ...
}
The RequiredComponent
attribute should only be used between component types, and it's also using the wrong constructor here (required / create default distinction) where multiple attributes would have been intended, like so:
[RequiredComponent(typeof(Foo))]
[RequiredComponent(typeof(Bar))]
Regardless, the editor of course shouldn't crash. Instead, there should be a warning about unintended usage and a proper error handling when something like this shows up in a plugin.
Yep! Sorry about that. I realized when going back through, after separating the required attributes, that those types aren't even components (like what's mentioned in the attribute name itself).
My misunderstanding carried over from requiring a RigidBody on another component - My brain went, "This class needs these two things, so I should do it this way, right?" Without realizing that attribute is for components only, not resources.
Fixed, and release in progress. Package update should be out there in about 15 minutes.
Summary
Not sure entirely what's triggering this, but at some point when rebuilding my plugins, the Duality Editor decides to continually crash.
How to reproduce [Bugs]
So as far as I know, these are the steps I took:
Extra:
Removing that public line from the importer class doesn't fix the crashes. As far as I'm aware, that had nothing to do with the actual crash - It seemed to just be the trigger for corrupting whatever's crashing the editor.
Workaround [Bugs]
Attachments
Note: I had to delete the contents of Source/Packages to get the zip below the file size limit. The packages were the standard Duality stuff: