snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.59k stars 291 forks source link

BlockReference overrides all Flowchart references when a BlockReference is added to a List #1009

Open caseyweederman opened 3 years ago

caseyweederman commented 3 years ago

Describe the bug

Adding a BlockReference to a List sets all existing entries to refer to the same Flowchart, and each entry changed by this has its block set to None. This happens in the Inspector, using the List dropdown, and in C# when Adding or Inserting BlockReferences to a List.

To Reproduce Inspector:

  1. In a new scene, add two Flowcharts with any nonzero number of blocks
  2. Add a script to a GameObject: using Fungus; and public field List
  3. In the inspector, add an element, select a Flowchart, select a Block in the resulting dropdown
  4. Add a second element, selecting a different Flowchart

C#:

  1. In a script with a List and two or more BlockReferences referring to blocks in different flowcharts, Add() one and then the other.

Expected behavior Each element in a BlockReference List should be able to refer to a different Flowchart, and that adding entries to such a list would not change every existing element of that list

Versions & Platform (please complete the following information):

Screenshot Fungus BlockReference behavior in a List