public void SpawnQuestion(MapQuestion mp, MapLocationScript mls) { foreach (GameObject go in currentAnswerList) { Destroy(go); } currentAnswerList.Clear(); currentLocation = mls; currentQuestion = mp; questionText.text = currentQuestion.questionText; List <int> randMeshes = GlobalVariables.genUniqueNumbers(0, currentQuestion.answerList.Count, currentQuestion.answerList.Count); questionAnswers = currentQuestion.answerList.ToList(); float offsetStep = 5.0f / (questionAnswers.Count + 1); float curOffset = -3.0f + offsetStep; for (int i = 0; i < currentQuestion.answerList.Count; i++) { GameObject tmpAnsBtn = Instantiate(answerPref, answerHolder.transform); tmpAnsBtn.GetComponent <MapAnswerScript>().SetAnswer(questionAnswers[i], ansRocksList[randMeshes[i]], this); tmpAnsBtn.transform.localPosition = new Vector3(0.0f, 0.0f, curOffset); currentAnswerList.Add(tmpAnsBtn); curOffset += offsetStep; } StartCoroutine(GlobalVariables.FocusOn(Camera.main.transform, transform, 1.5f)); }
internal void PickValues(MapQuestion openQuestion) { _mapQuestion = openQuestion; textBoxQuestionText.Text = _mapQuestion.QuestionText; textBoxName.Text = _mapQuestion.Name; }
private void AddMapQuestion() { MapQuestion mapQn = (MapQuestion)_section.Questions.Add(QuestionTypes.Map); MapQuestionForm MapQnFrm = new MapQuestionForm(); MapQnFrm.PickValues(mapQn); if (MapQnFrm.ShowDialog() == DialogResult.OK) { RefreshQuestions(); } }
private void AddMapQuestion() { if (!(Tree.SelectedNode.Tag is Questions)) { return; } Questions questions = Tree.SelectedNode.Tag as Questions; MapQuestion mapQn = (MapQuestion)questions.Add(QuestionTypes.Map); MapQuestionForm MapQnFrm = new MapQuestionForm(); MapQnFrm.PickValues(mapQn); if (MapQnFrm.ShowDialog() == DialogResult.OK) { TreeNode questionsNode = Tree.SelectedNode; if (questionsNode != null) { var questionNode = AddToParentNode(questionsNode, mapQn, mapQn.Name); questionNode.ImageIndex = 10; questionNode.SelectedImageIndex = 10; } } }
public static Question CreateQuestion(DCAnalyticsObject parent, QuestionTypes qtype) { Question question = null; switch (qtype) { case QuestionTypes.Closed: question = new ClosedQuestion(parent); break; case QuestionTypes.MultipleChoice: question = new MultipleChoiceQuestion(parent); break; case QuestionTypes.Open: question = new OpenQuestion(parent); break; case QuestionTypes.Map: question = new MapQuestion(parent); break; case QuestionTypes.Location: question = new LocationQuestion(parent); break; case QuestionTypes.Other: question = new OtherQuestion(parent); break; } if (question != null) { question.QuestionType = qtype; } return(question); }
public void SetupQuestion(MapQuestion question, Sprite icon) { myIcon = icon; mySprite.sprite = myIcon; myQuestion = question; }