コード例 #1
0
        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);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            QuestionsFactory questionsFactory = new QuestionsFactory();

            questionsFactory.DisplayQuestions();
            Console.ReadKey();
        }
コード例 #3
0
        /// <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());
        }