public Transform BuildTag(string[] strArray) { string tagText = strArray[0]; print(strArray[1]); int vocabTagged = int.Parse(strArray[1]); GameObject tagGo = Instantiate(TagPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; tagGo.transform.GetComponentInChildren <InputField>().text = tagText; print("building tag"); if (vocabTranslationListUI.IsItemSelectedInGroup(vocabTranslationListUI.VocabTranslationSelected)) { if (vocabTagged == 1) { tagGo.GetComponent <TranslationTag>().ActivateAddRule(true); } else { tagGo.GetComponent <TranslationTag>().ActivateAddRule(false); } } tagGo.GetComponentInChildren <InputField>().text = tagText; tagGo.GetComponent <TranslationTag>().TagText = tagText; //grammarRule.transform.SetParent(ruleList.transform, false); return(tagGo.transform); }
public Transform BuildRule(string[] strArray) { string ruleID = strArray[0]; string descriptionStr = strArray[1]; int translationRule = int.Parse(strArray[2]); grammarRule = Instantiate(grammarRulePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; grammarRule.transform.Find("DescriptionInput").GetComponent <InputField>().text = descriptionStr; if (vocabTranslationListUI.IsItemSelectedInGroup(vocabTranslationListUI.VocabTranslationSelected)) { if (translationRule == 1) { grammarRule.GetComponent <GrammarRule>().ActivateAddRule(true); } else { grammarRule.GetComponent <GrammarRule>().ActivateAddRule(false); } } grammarRule.transform.Find("RuleNumber").GetComponent <Text>().text = ruleID; grammarRule.GetComponent <GrammarRule>().CurrentDescription = descriptionStr; grammarRule.GetComponent <GrammarRule>().RuleNumber = ruleID; //grammarRule.transform.SetParent(ruleList.transform, false); return(grammarRule.transform); }