void Start() { isAnimating_ = false; countdown_ = 0; player_ = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); typeWriter_ = player_.GetComponent <TypeWriter>(); playerIsNear_ = false; typeWriter_.RegisterWord("use", WordListener); }
void Start() { GameObject playerObject = GameObject.FindGameObjectWithTag("Player"); rigidbody_ = GetComponent <Rigidbody2D>(); collider_ = GetComponent <BoxCollider2D>(); audio_ = GetComponent <AudioSource>(); if (playerObject != null) { player_ = playerObject.GetComponent <Player>(); TypeWriter typeWriter = playerObject.GetComponent <TypeWriter>(); typeWriter.RegisterWord("use", WordListener); typeWriter.RegisterWord("throw", WordListener); } else { Debug.LogWarning("Couldn't find player object in the scene. Crates won't function now."); } }
void Start() { typeWriter_ = GetComponent <TypeWriter>(); typeWriter_.RegisterWord("start", WordListener); typeWriter_.RegisterWord("select", WordListener); typeWriter_.RegisterWord("menu", WordListener); typeWriter_.RegisterWord("tutorial1", WordListener); typeWriter_.RegisterWord("tutorial2", WordListener); typeWriter_.RegisterWord("tutorial3", WordListener); typeWriter_.RegisterWord("tutorial4", WordListener); typeWriter_.RegisterWord("tutorial5", WordListener); typeWriter_.RegisterWord("tutorial6", WordListener); typeWriter_.RegisterWord("level1", WordListener); typeWriter_.RegisterWord("level2", WordListener); typeWriter_.RegisterWord("level3", WordListener); fadeToBlack_ = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>(); }
void Start() { typeWriter_.RegisterWord("jump", OnWord); typeWriter_.RegisterWord("turn", OnWord); typeWriter_.RegisterWord("shoot", OnWord); typeWriter_.RegisterWord("reset", OnWord); typeWriter_.RegisterWord("kys", OnWord); typeWriter_.RegisterWord("next", OnWord); typeWriter_.RegisterWord("menu", OnWord); typeWriter_.RegisterWord("tutorial1", OnWord); typeWriter_.RegisterWord("tutorial2", OnWord); typeWriter_.RegisterWord("tutorial3", OnWord); typeWriter_.RegisterWord("tutorial4", OnWord); typeWriter_.RegisterWord("tutorial5", OnWord); typeWriter_.RegisterWord("tutorial6", OnWord); typeWriter_.RegisterWord("level1", OnWord); typeWriter_.RegisterWord("level2", OnWord); typeWriter_.RegisterWord("level3", OnWord); typeWriter_.RegisterWord("level4", OnWord); typeWriter_.RegisterWord("level5", OnWord); startLocation_ = transform.position; audioSources_[1].Play(); }