protected void WrapQuestionInABox(IQuestion q) { var ll = q.gameObject.GetComponent <StillLetterBox>(); int placeholdersCount = 0; foreach (var p in q.GetPlaceholders()) { placeholdersCount++; } StillLetterBox[] boxes = new StillLetterBox[placeholdersCount + 1]; placeholdersCount = 0; foreach (var p in q.GetPlaceholders()) { boxes[placeholdersCount++] = p.GetComponent <StillLetterBox>(); } boxes[boxes.Length - 1] = ll; var box = ItemFactory.Instance.SpawnQuestionBox(boxes); box.Show(); audioManager.PlayPoofSound(); boxesList.Add(box); }
protected virtual void WirePlaceHolders(IQuestion question) { foreach (var p in question.GetPlaceholders()) { var behaviour = p.GetComponent <PlaceholderBehaviour>(); behaviour.Placeholder = new DragNDropPlaceholder(); behaviour.Placeholder.SetQuestion(question); placeholdersList.Add(behaviour); } }