private void SingletonInstance_OnParticipantStateChanged(object sender, InteractiveParticipantStateChangedEventArgs e) { if (e.State == InteractiveParticipantState.Left || e.State == InteractiveParticipantState.InputDisabled) { RelinquishControl(e.Participant); } }
private void OnParticipantStateChanged(object sender, InteractiveParticipantStateChangedEventArgs e) { // Every time a new participant joins randomly assign them to a new group. Groups can // be used to show different sets of controls to your audience. InteractiveParticipant participant = e.Participant; if (participant.State == InteractiveParticipantState.Joined && MixerInteractive.Groups.Count >= 2) { InteractiveGroup group1 = MixerInteractive.Groups[0]; InteractiveGroup group2 = MixerInteractive.Groups[1]; InteractiveGroup group3 = MixerInteractive.Groups[2]; int group = Mathf.CeilToInt(Random.value * 3); if (group == 1) { participant.Group = group1; group1Text.text += "\n" + participant.UserName; } else if (group == 2) { participant.Group = group2; group2Text.text += "\n" + participant.UserName; } else if (group == 3) { participant.Group = group3; group3Text.text += "\n" + participant.UserName; } } }
private void OnParticipantStateChange(object sender, InteractiveParticipantStateChangedEventArgs ev) { if (ev.State == InteractiveParticipantState.Joined) { ev.Participant.Group = MixerInteractive.GetGroup(_stateMachine.ParticipantStartGroup); } //TODO: We may want to handle the "leaving" state for any of the current set of players }
/// <summary> /// Event called for all participants arriving at the stream; only need particular handling /// for when game players leave /// </summary> public void OnParticipantStateChange(object sender, InteractiveParticipantStateChangedEventArgs ev) { if (ev.State == InteractiveParticipantState.Joined) { ev.Participant.Group = MixerInteractive.GetGroup(_stateMachine.ParticipantStartGroup); } else if (ev.State == InteractiveParticipantState.Left) { HandleParticipantLeave(ev.Participant); } }
void ParticipantStateChanged(object sender, InteractiveParticipantStateChangedEventArgs e) { InteractiveParticipant participant = e.Participant; if (e.State == InteractiveParticipantState.Joined) { print(participant.UserName + " joined"); } if (e.State == InteractiveParticipantState.Left) { print(participant.UserName + " left"); } if (e.State == InteractiveParticipantState.InputDisabled) { print(participant.UserName + " input disabled"); } }