// Use this for initialization void Start() { Instantiate(floorTiles1, new Vector3(2.024f, -1.026f, 0), Quaternion.identity); sr = Background.GetComponent <SpriteRenderer>(); fScript = GameObject.FindGameObjectWithTag("floor").GetComponent <FloorMovement>(); eScript = GameObject.FindGameObjectWithTag("spawner").GetComponent <enemySpawn>(); Screen.SetResolution(640, 480, true); anim = transform.gameObject.GetComponent <Animator>(); levelno = 1; }
IEnumerator Die() { fScript = GameObject.FindGameObjectWithTag("floor").GetComponent <FloorMovement>(); ps.Play(); squash.Play(); isDead = true; anim.SetBool("IsDead", true); fScript.ifDead = true; eScript.ifDead = true; yield return(new WaitForSeconds(3)); ps.Stop(); yield return(new WaitForSeconds(0.5f)); Application.LoadLevel("GameOver"); }