public baseWordAlphaTypingMonster(string word, AlphaTypingMonsterSpawner spawner, Vector3 originalPosition, Vector3 normalizeDirection, int isRight) { this._word = word; typeIndex = 0; wordBox = spawner.SpawnWord(originalPosition, normalizeDirection, isRight); wordBox.SetWord(word); wordBox.setMoveDirection(spawner.GetIsRight()); wordBox.SetNormalizeDirection(spawner.GetNormalizeDirection()); }
public AlphaTypingMonsterBox SpawnWord(Vector3 originalPosition, Vector3 normalizeDirection, int isRight) { GameObject wordObj = Instantiate(wordPrefab, originalPosition, Quaternion.identity, rectCanvas); this.isRight = isRight != 0; this.normalizeDirection = normalizeDirection; AlphaTypingMonsterBox wordDisplay = wordObj.GetComponent <AlphaTypingMonsterBox>(); return(wordDisplay); }