public void Create() { var scene = EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single); // Setup scene AddEventSystemToScene(); AddCanvasToScene(); AddPanelToCanvas(); AddSubmitButtonToPanel(); AddIntroTextToPanel(); // add questions var questionFactory = new QuestionsFactory(this._panel); foreach (var question in _questions) { if (question.Value != QuestionType.Empty) { questionFactory.CreateQuestion(question.Value).name = question.Key.Name; } } // save the scene (open save file form) EditorSceneManager.SaveScene(scene); }
static void Main(string[] args) { QuestionsFactory questionsFactory = new QuestionsFactory(); questionsFactory.DisplayQuestions(); Console.ReadKey(); }
/// <inheritdoc /> /// <exception cref="IOException">Thrown if unable to read from <seealso cref="SourceFile"/>.</exception> public IEnumerable <IQuestion> Convert() { var stream = new MemoryStream(); using (var richTextBox = new RichTextBox()) { richTextBox.LoadFile(SourceFile); richTextBox.SaveFile(stream, RichTextBoxStreamType.PlainText); } var questionsFactory = new QuestionsFactory(stream); return(questionsFactory.Build()); }