YarnSpinnerTool / YarnSpinner-Unity

The official Unity integration for Yarn Spinner, the friendly dialogue tool.
MIT License
508 stars 90 forks source link

AddCommandHandler<string[]> doesn't register command with arbitrary number of parameters #260

Open dario-zubovic opened 10 months ago

dario-zubovic commented 10 months ago

What is the current behavior? If method is registered with AddCommandHandler<string[]> instead of [YarnCommand], it's not registered correctly and throws error at play time: image

What is the expected behavior? It's expected that AddCommandHandler method behaves the same as YarnCommand attribute and register command that takes arbitrary number of parameters.

Please tell us about your environment:

Other information

Can't call command (X): incorrect number of parameters
UnityEngine.Debug:LogError (object)
Yarn.Unity.DialogueRunner:HandleCommand (Yarn.Command) (at ./Library/PackageCache/dev.yarnspinner.unity@2.4.0/Runtime/DialogueRunner.cs:903)
Yarn.VirtualMachine:RunInstruction (Yarn.Instruction)
Yarn.VirtualMachine:Continue ()
Yarn.Dialogue:Continue ()
Yarn.Unity.DialogueRunner:ContinueDialogue (bool) (at ./Library/PackageCache/dev.yarnspinner.unity@2.4.0/Runtime/DialogueRunner.cs:1142)
Yarn.Unity.DialogueRunner:SelectedOption (int) (at ./Library/PackageCache/dev.yarnspinner.unity@2.4.0/Runtime/DialogueRunner.cs:1083)
Yarn.Unity.OptionsListView/<<RunOptions>g__OptionViewWasSelectedInternal|15_2>d:MoveNext () (at ./Library/PackageCache/dev.yarnspinner.unity@2.4.0/Runtime/Views/OptionsListView.cs:176)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)