IEnumerator MoveCursorThreeChoicesPanelUp() { movingCursor = true; if (currentChoice == ChoiceSelected.Option1) { cursor.transform.position = option3CursorPosition.position; currentChoice = ChoiceSelected.Option3; } else if (currentChoice == ChoiceSelected.Option2) { cursor.transform.position = option1CursorPosition.position; currentChoice = ChoiceSelected.Option1; } else { cursor.transform.position = option2CursorPosition.position; currentChoice = ChoiceSelected.Option2; } yield return(new WaitForSeconds(timeBetweenEachCursorMovement)); movingCursor = false; }
void SetupChoicesPanel(Sentence sentence) { choicesActive = true; dialogueActive = false; rightDialogElements.SetActive(false); leftDialogElements.SetActive(false); choicesPanel.SetActive(true); choiceMessage.text = sentence.text; option1.text = sentence.choices[0].text; option2.text = sentence.choices[1].text; if (sentence.choices.Count > 2) { option3.enabled = true; option3.text = sentence.choices[2].text; } else { option3.enabled = false; } cursor.transform.position = option1CursorPosition.position; option1Panel.color = new Color(option1Panel.color.r, option1Panel.color.g, option1Panel.color.b, 40f / 255); option2Panel.color = new Color(option2Panel.color.r, option2Panel.color.g, option2Panel.color.b, 0); option3Panel.color = new Color(option3Panel.color.r, option3Panel.color.g, option3Panel.color.b, 0); currentChoice = ChoiceSelected.Option1; }
public void ChangeChoice(int choiceIndex) { if (choiceIndex == 1) { cursor.transform.position = option1CursorPosition.position; currentChoice = ChoiceSelected.Option1; option1Panel.color = new Color(option1Panel.color.r, option1Panel.color.g, option1Panel.color.b, 40f / 255); option2Panel.color = new Color(option2Panel.color.r, option2Panel.color.g, option2Panel.color.b, 0); option3Panel.color = new Color(option3Panel.color.r, option3Panel.color.g, option3Panel.color.b, 0); } else if (choiceIndex == 2) { cursor.transform.position = option2CursorPosition.position; currentChoice = ChoiceSelected.Option2; option1Panel.color = new Color(option1Panel.color.r, option1Panel.color.g, option1Panel.color.b, 0); option2Panel.color = new Color(option2Panel.color.r, option2Panel.color.g, option2Panel.color.b, 40f / 255); option3Panel.color = new Color(option3Panel.color.r, option3Panel.color.g, option3Panel.color.b, 0); } else if (choiceIndex == 3) { cursor.transform.position = option3CursorPosition.position; currentChoice = ChoiceSelected.Option3; option1Panel.color = new Color(option1Panel.color.r, option1Panel.color.g, option1Panel.color.b, 0); option2Panel.color = new Color(option2Panel.color.r, option2Panel.color.g, option2Panel.color.b, 0); option3Panel.color = new Color(option3Panel.color.r, option3Panel.color.g, option3Panel.color.b, 40f / 255); } }
protected async Task OnChoiceSelected(bool value) { Display = false; await ChoiceSelected.InvokeAsync(value); }