private Speaker GetSpeaker(IDialogueContext context) { if (context.OnlyPlayer()) { return(speakers[playerSpeaker]); } if (context.ProceedToNextSpeaker()) { return(speakers[++currentSpeakerIndex % speakerCount]); } return(speakers[currentSpeakerIndex % speakerCount]); }
private Speaker GetSpeaker(IDialogueContext context) { if (context.OnlyPlayer()) { // If the current context also proceeds to next speaker then increment after returning the player speaker index. return(speakers[(context.ProceedToNextSpeaker()) ? playerSpeaker++ : playerSpeaker]); } if (context.ProceedToNextSpeaker()) { return(speakers[currentSpeakerIndex++ % speakerCount]); } return(speakers[currentSpeakerIndex % speakerCount]); }