private void SetupChoices(MainModel model, string question, IList<Choice> choices) { // Setup callback foreach (var c in choices) { var choice = c; var isCorrect = choice.IsCorrect; Action choiceCallback = () => { // Goto choice model.ChoicesModel.ActiveChoiceIndex = model.ChoicesModel.Choices.IndexOf(choice); RespondToAnswerImmediate(isCorrect); // Delay non-game response this.StartCoroutineWithDelay(() => { // Remove choice if (model.ChoicesModel.Choices.Contains(choice)) { model.ChoicesModel.Choices.Remove(choice); model.ChoicesModel.ActiveChoiceIndex = null; //if (model.ChoicesModel.ActiveChoiceIndex >= model.ChoicesModel.Choices.Count) //{ // model.ChoicesModel.ActiveChoiceIndex = model.ChoicesModel.Choices.Count - 1; //} // Do Callback RespondToAnswerDelayed(isCorrect); } }, 1f); }; c.ChoiceCallback = choiceCallback.OnlyOnce(); } var randomOrder = choices.RandomizeOrder(); model.ChoicesModel.Choices.Clear(); model.ChoicesModel.Choices.AddRange(randomOrder); //model.ChoicesModel.ShouldShowChoices = true; model.ChoicesModel.ActiveChoiceIndex = null; model.ChoicesModel.Question = question; }