Ah I see, from my experience it’s not possible to reorder the actual list of choices on the multiple-choice node. But from looking at MultipleChoiceNode.cs it should be relatively easy to implement reorder up/down buttons, as the availableChoices list just needs to be reordered.
Edit: It actually is very easy. Open up MultipleChoiceNode.cs and after
1
2
3
4
5
6
7
8
9
if(GUILayout.Button("X",GUILayout.Width(20)))
{
availableChoices.RemoveAt(i);
if(i<outConnections.Count)
{
graph.RemoveConnection(outConnections[i]);
}
}
add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
GUI.enabled=i>0;
if(GUILayout.Button("UP",GUILayout.Width(30)))
{
varprevious=availableChoices[i-1];
availableChoices[i-1]=availableChoices[i];
availableChoices[i]=previous;
}
GUI.enabled=i<availableChoices.Count-1;
if(GUILayout.Button("DN",GUILayout.Width(30)))
{
varprevious=availableChoices[i+1];
availableChoices[i+1]=availableChoices[i];
availableChoices[i]=previous;
}
GUI.enabled=true;
That does allow you to reorder the choices with two buttons, moving the choice up or down. I haven’t tested the behaviour at runtime though, maybe the connections and the attached conditions won’t get reordered properly, even though in the graph editor it all seems to be correct.
Login
Register
By registering on this website you agree to our Privacy Policy.