//Make letter group, set the base letter and diacritic, run Populating Functions within the letter group. public void InstantiateAndPopulateLetterGroup(int _indexOfFirstUnderscore, int _letterGroupLength , GameObject _letterGroupPrefab, Transform _InstPointTransform, string _LetterGroup, bool isHiragana) { GameObject g_letterGroup = Instantiate(_letterGroupPrefab, _InstPointTransform); g_letterGroup.transform.SetParent(gameObject.transform); LetterFormation _LetterGroupScript = g_letterGroup.GetComponent <LetterFormation>(); //If it's not Hiragana, set base letter and diacritic. if (!isHiragana) { _LetterGroupScript.S_BaseLetter = _LetterGroup.Substring(0, _indexOfFirstUnderscore + 1); _LetterGroupScript.S_Diacritic = _LetterGroup.Substring(_indexOfFirstUnderscore, _letterGroupLength - _indexOfFirstUnderscore); } //Otherwise just set base letter. else { _LetterGroupScript.S_BaseLetter = _LetterGroup; } //Populate the letter group based on whether it's hiragana or not. _LetterGroupScript.AllPopulatingFunctions(isHiragana); }
//Store value of correct key. public void PassInCorrectKey(LetterFormation _correctKey) { LetFor_correctKey = _correctKey; }
//Instantiates a single devanagari. Used from Keyboard to overlay on top of a hiragana value. public void InstantiateSingleDevanagari(LetterFormation _HiraganaInQuestion) //Used by the Keyboard script to input the correct letters. { SetInstantiationPoint(_HiraganaInQuestion.transform.position.x, _HiraganaInQuestion.transform.position.y); InstantiateAndPopulateLetterGroup(FindCharacterIndexInString(_HiraganaInQuestion.S_BaseLetter, c_underscore[0]), _HiraganaInQuestion.S_BaseLetter.Length , G_LetterGroupPrefab, T_InstantiationPoint.transform, _HiraganaInQuestion.S_BaseLetter, false); }