Esempio n. 1
0
        static DataMessenger()
        {
            LastQuestion = new QuestionData();
            LastQuestion.Question = "Find the false sentence.";
            LastQuestion.Answers = new List<string> { "Pyrite was used as a source of ignition in early firearms in the 16th and 17th centuries,", "Pyrite remains in commercial use for the production of sulfur dioxide (use in e.g., paper industry),", "Pyrite is often associated with harder chalcopyrite (CuFeS<ss>2</ss>)." };

            LastQuestion.Question = "Find the false sentence. odhfasdo hfdosuhf asdoihfasdi f asdiohf asdohf fh asdklhf asdhf asdp fasdiohf aiosh fasdioh fasdkl END";
            LastQuestion.Answers = new List<string> { "Dogs can see blue and yellow, but have difficulty differentiating red and green colours,", "The height of dogs measured to the withers ranges from 15.2 centimetres in the Chihuahua to about 76 cm in the Irish Wolfhound,", "The dog was the last domesticated animal." };
            LastQuestion.CorrectAnswerIndex = 0;

            LastSetsQuery = string.Empty;
            NumberOfPlayers = 1;
        }
Esempio n. 2
0
        public CardData(int id, string image, QuestionData question1, QuestionData question2)
            : this()
        {
            Id    = id;
            Image = image;

            if (question1 != null)
            {
                Questions.Add(question1);
            }

            if (question2 != null)
            {
                Questions.Add(question2);
            }
        }
Esempio n. 3
0
        public CardData(int id, string image, QuestionData question1, QuestionData question2)
            : this()
        {
            Id = id;
            Image = image;

            if (question1 != null)
            {
                Questions.Add(question1);
            }

            if (question2 != null)
            {
                Questions.Add(question2);
            }
        }
Esempio n. 4
0
        public void GenerateQuestions(QuestionData question)
        {
            Debug.Log("Image position: " + ImagePosition);
            scaledSmallFontSize = Scale(SmallFontSize);
            scaledNormalFontSize = Scale(NormalFontSize);

            currentQuestion = question;
            isEnabled = true;

            answerPositions.Clear();
            answerContents.Clear();
            answerStyles.Clear();
            dotPositions.Clear();

            Vector3 screenPosition = Camera.main.WorldToScreenPoint(transform.position);

            dotContent = new GUIContent(DotTexture);
            dotStyle = new GUIStyle();
            dotStyle.fixedWidth = dotStyle.fixedHeight = Scale(20);

            questionStyle = new GUIStyle();
            questionStyle.richText = true;
            questionStyle.wordWrap = true;
            questionStyle.fontSize = scaledNormalFontSize;
            //questionStyle.fontStyle = FontStyle.Bold;
            questionStyle.font = DefaultFont;

            string text = "<color=#503a28>" + question.Question + "</color>";
            questionContent = new GUIContent(TextFormatting.ProcessTags(text, scaledSmallFontSize));

            int scaledWidth = Scale(QuestionWidth);
            questionPosition = new Rect(screenPosition.x, Screen.height - screenPosition.y, scaledWidth, Scale(100));

            float height = TextFormatting.CalculateHeight(questionContent, questionStyle, scaledWidth) + Scale(16);

            int i = 0;
            foreach (var answer in question.Answers)
            {
                height = AddQuestion(answer, height, i);
                ++i;
            }
        }
Esempio n. 5
0
 public CardData(int id, string image, QuestionData question)
     : this(id, image, question, null)
 {
 }
Esempio n. 6
0
 public CardData(int id, string image, QuestionData question)
     : this(id, image, question, null)
 {
 }