On some newer versions of Unity, the BlockInspector will crash whenever the user selects a block in the flowchart window.
The inspector window will not populate, and the console will throw null reference errors every editor frame as long as the block is selected.
This is due to `activeBlockEditor` never getting instantiated properly. I suspect that this is due to recent API changes that made `Editor.CreateEditor(block)` create a generic Editor object, instead of a BlockEditor. Since the object is not actually the extended type, the reference becomes null after being cast using `as`.
This overload parameter ensures that the object is instantiated using the correct type. This fix should work for all versions, as it appears to have been an API option since at least Unity 5.2
Tested on Unity 2018.0.1f1 and 2019.2.1f1
-Nulls are getting into these collections in error. Seems to be due to SelectedBlocks serialising and not being refreshed correctly when something is deleted or removed outside of FlowchartWindow's control or a lingering null from a previous version.
Updated Changelog
- Flowchart can identify add variables found via the substitute regex
- Commands that use SubstituteVariables on their string data use the new caching method so they can highlight variables that will be used during substitution
- GUILayout.*Area no longer used was resulting in 0 pixels drawn
- Inspector height calc no longer driven by layout option that was filling 0 pixels
- Resize bar changes to correctly position and minimise incorrect values
FadeUI also checks for CanvasGroups and if 2018_1_OR_NEWER will check for TMP_Text also
TextAdapter uses 2018_1_OR_NEWER for more thorough support of TMPro such as color and rich text operations
- SetSprite - changes the image on the SpriteRenderer of one or more GameObjects
- SetUIImage - changes the image on the Image of one or more GameObjects
Allows for circumstances where you want to call a block that completes immediately multiple times such as in recursion.
Removes the need to put Wait 1 Frame commands in a number of cases
More verbose logging in cases where a block cannot be called as it is already running
Blocks now track their selectedness and filteredness to avoid hundreds of contains calls every Draw
Only recalculate filtered collection and total blocks on flowchart when a change has occured
Minor change to Conversation regex grouping
Added Conversation Tests for existing functionality and multi colon
-Conversation Parse refactor to allow for static testing
Moved all regex strings across fungus to const strings
Avoids or allows Unity to internally deal with the assertion that arrise from PrefabUtil when passing a prefab with UI elements. Change is not a concern here as in this case we are intentionally removing the prefab link that would be able to be maintained by the PrefabUtil.