//!Definiuje UI części zwijanej. private void foldoutSetup() { foldout = new Foldout(); foldout.value = false; choiceName = new TextField(); choiceName.label = "Choice title:"; makesChoice = new Toggle(); makesChoice.text = "Makes a choice?"; makesChoice.value = true; charismaField = new TextField(); deceptionField = new TextField(); thoughtfulnessField = new TextField(); charismaField.label = "Charisma requirement:"; deceptionField.label = "Deception requirement:"; thoughtfulnessField.label = "Thoughtfulness requirement:"; foldout.contentContainer.Add(makesChoice); foldout.contentContainer.Add(choiceName); narrativePathCheckboxesSetup(); foldout.contentContainer.Add(charismaField); foldout.contentContainer.Add(deceptionField); foldout.contentContainer.Add(thoughtfulnessField); foldout.SetEnabled(false); }
//!Umożliwia edycję właściwości portu/odpowiedzi. private void editResponse(ChoiceData choiceData) { foldout.SetEnabled(true); foldout.value = true; choiceName.value = choiceData.ChoiceTitle; choiceName.RegisterCallback <InputEvent, ChoiceData>(setChoiceName, choiceData); makesChoice.value = choiceData.WasMade; makesChoice.RegisterCallback <MouseUpEvent, ChoiceData>(setChoiceOutcome, choiceData); foreach (Toggle narrativeType in narrativeTypeToggles) { narrativeType.RegisterCallback <MouseUpEvent, ChoiceData>(setNarrativePath, choiceData); if (choiceData.Path.ToString() == narrativeType.text) { narrativeType.value = true; } else { narrativeType.value = false; } } charismaField.value = choiceData.RequiredCharisma.ToString(); charismaField.RegisterCallback <InputEvent, ChoiceData>(setCharismaRequirement, choiceData); deceptionField.value = choiceData.RequiredDeception.ToString(); deceptionField.RegisterCallback <InputEvent, ChoiceData>(setDeceptionRequirement, choiceData); thoughtfulnessField.value = choiceData.RequiredThoughtfulness.ToString(); thoughtfulnessField.RegisterCallback <InputEvent, ChoiceData>(setThoughtfulnessRequirement, choiceData); }