void Start() { Time.timeScale = 1; textPainter = this.gameObject.transform.GetChild(0).gameObject; timeAtStart = Time.time; allTheAiRacers = GameObject.FindGameObjectsWithTag("Enemy").OrderBy(go => go.name).ToArray(); spl = (SpawnLetter)textPainter.GetComponent(typeof(SpawnLetter)); }
private void CreateLetter(GameObject collision, Word word) { if (collision.GetComponent <SpawnLetter>()) { SpawnLetter spawner = collision.GetComponent <SpawnLetter>(); spawner.MakeSprite(word.word); } else { Debug.Log("NoSpawner"); } }
private void GameOver() { StopAllCoroutines(); m_Sprite.color = m_InitialColor; m_Animator.SetBool("IsDead", true); SoundManager.PlayMultiple(m_DeathSound); GetComponent <BoxCollider2D> ().enabled = false; SpawnLetter spawnLetter = GetComponent <SpawnLetter> (); if (spawnLetter != null) { spawnLetter.Spawn(); } Destroy(gameObject, 1); GameManager.score += 10; }